Skip to content

Refactor formatter file grouping helpers - #3538

Open
rooKywooKy wants to merge 1 commit into
koalaman:masterfrom
rooKywooKy:rookywooky-code-duplication-refactor
Open

rooKywooKy wants to merge 1 commit into
koalaman:masterfrom
rooKywooKy:rookywooky-code-duplication-refactor

Conversation

@rooKywooKy

Copy link
Copy Markdown

Why

Several formatter modules were repeating the same per-file comment grouping and file loading logic. The duplication made the formatters harder to maintain and left room for subtle drift between implementations.

What changed

  • Added shared commentsByFile and readCommentsForFile helpers in src/ShellCheck/Formatter/Format.hs
  • Reused the shared helpers in the GCC, CheckStyle, JSON1, and TTY formatters
  • Kept the existing formatter behavior intact while removing the repeated code paths

Validation

  • cabal update
  • cabal test --test-show-details=direct

Closes #0000

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants