Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add output format option with 'gcc' #319

Merged

Conversation

vnayar
Copy link
Contributor

@vnayar vnayar commented Dec 28, 2023

Relating to #145, a new command-line option was added. The current output format is named 'default', and a new format 'gcc' was added that uses an error format similar
to gcc, namely: <file>:<lineNo>:<charNo>: <type/severity>: <message>

This command-line option mirrors that used by the common linting tool shellcheck: https://www.mankier.com/1/shellcheck

Example output:

$ ./bin/ec --format=gcc ~/files/dummy.*
../../files/dummy.bat:0:0: error: Wrong line endings or no final newline
../../files/dummy.bat:0:0: error: Not all lines have the correct end of line character
../../files/dummy.d:2:0: error: Line too long (113 instead of 100)
../../files/dummy.d:3:0: error: Wrong amount of left-padding spaces(want multiple of 2)

@vnayar vnayar changed the title Add output format option with 'gcc' feat: Add output format option with 'gcc' Dec 28, 2023
@vnayar
Copy link
Contributor Author

vnayar commented Dec 29, 2023

I modified the commit description to have the prefix feat:, which I believe is what was causing the build to fail, although I'm not 100% sure. Please approve execution of the workflow.

@vnayar
Copy link
Contributor Author

vnayar commented Dec 29, 2023

Another force-push due to the subject line of the commit being rejected with the following error:

✖   subject must not be sentence-case, start-case, pascal-case, upper-case [subject-case]

I am guessing that capitalizing the letters in the subject will resolve this, but I have no way of checking until the workflow is run.

@vnayar vnayar changed the title feat: Add output format option with 'gcc' feat: add output format option with 'gcc' Dec 30, 2023
@vnayar
Copy link
Contributor Author

vnayar commented Dec 30, 2023

I cannot find any documentation regarding the proper case for commit message titles, but all the other examples that are present use lower case. I am making yet another attempt to satisfy this commit linting tool. Please re-run the workflow, because currently only maintainers can do this.

@vnayar
Copy link
Contributor Author

vnayar commented Dec 30, 2023

Updated testfiles/generated-config to include an empty "format" value.

Copy link

codecov bot commented Dec 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (da7e006) 84.58% compared to head (672dc63) 84.89%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #319      +/-   ##
==========================================
+ Coverage   84.58%   84.89%   +0.31%     
==========================================
  Files           8        8              
  Lines         681      695      +14     
==========================================
+ Hits          576      590      +14     
  Misses         81       81              
  Partials       24       24              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Relating to editorconfig-checker#145, a new command-line option  was added. The current output format is
named 'default', and a new format 'gcc' was added that uses an error format similar
to gcc, namely:  <file>:<lineNo>:<charNo>: <type/severity>: <message>

This command-line option mirrors that used by the common linting tool shellcheck:
https://www.mankier.com/1/shellcheck
@vnayar
Copy link
Contributor Author

vnayar commented Jan 8, 2024

When time permits, please take a look. The option to alter the output format is called "--format" and the first added alternative is "gcc". The output format and commnd-line options are inspired from https://www.shellcheck.net/

@vnayar
Copy link
Contributor Author

vnayar commented Jan 19, 2024

@mstruebing Could you take a moment to look at this PR to add a --format option, with one additional format so far, --format=gcc, which outputs line-oriented output similar to gcc. The option name and value were borrowed from the common linting tool shellcheck.

Copy link
Member

@mstruebing mstruebing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you this is a good PR.
Sorry for taking so long.

@mstruebing mstruebing merged commit 0f427b5 into editorconfig-checker:main Jan 20, 2024
5 checks passed
@mstruebing
Copy link
Member

I've created a new release, 2.8.
Can #145 be closed or does this issue still needs to be open or can it be closed?

@vnayar
Copy link
Contributor Author

vnayar commented Jan 20, 2024

I've created a new release, 2.8. Can #145 be closed or does this issue still needs to be open or can it be closed?

I believe all the described conditions of #145 have been satisfied, namely:

Though the output of editorconfig-checker is human friendly, it is complicated to parse in other tools. A more repetitive one line output format is basic but at least somewhat common. An option to fully print each error per line would be great.

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.

None yet

2 participants