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

Only report files with violations in txt mode #243

Closed
kf6kjg opened this issue Oct 5, 2022 · 1 comment · Fixed by #245
Closed

Only report files with violations in txt mode #243

kf6kjg opened this issue Oct 5, 2022 · 1 comment · Fixed by #245

Comments

@kf6kjg
Copy link
Contributor

kf6kjg commented Oct 5, 2022

When I'm using this manually on the CLI I'm only interested in the files that have violations. Having hundreds of files scroll past my screen that have no violations adds a lot of noise to the signal I'm looking for.

I don't care if I have to set a flag, choose a different output formatter, or what.
Looks like the relevant line of code is https://github.com/nvuillam/npm-groovy-lint/blob/master/lib/output.js#L111
What's your preference for this?

For example, the text output could look like the following:

/app/vars/updateCosmos.groovy
  2     info     The [io.myorg.Globals] import is never referenced  UnusedImport            
  12    warning  Method parameter [args] is never referenced in the method call of class None  UnusedMethodParameter   
  28    info     The statement on line 28 in class None is at the incorrect indent level: Expected one of columns [13, 17, 21] but was 9  Indentation             


npm-groovy-lint results in 93 linted files:
┌─────────┬───────────┬─────────────┐
│ (index) │ Severity  │ Total found │
├─────────┼───────────┼─────────────┤
│    0    │  'Error'  │      4      │
│    1    │ 'Warning' │     27      │
│    2    │  'Info'   │     165     │
└─────────┴───────────┴─────────────┘

instead of what happens currently:

/app/vars/initializePipeline.groovy

/app/vars/inputJenkinsJobCheck.groovy

/app/vars/npmAuditSecurityCheck.groovy

/app/vars/npmCINoFund.groovy

/app/vars/npmEnvCheck.groovy

/app/vars/npmJestUnitTest.groovy

/app/vars/npmRunBuild.groovy

/app/vars/npmRunIntegration.groovy

/app/vars/npmRunMigration.groovy

/app/vars/npxCodeComplexityCheck.groovy

/app/vars/onFailure.groovy

/app/vars/updateCosmos.groovy
  2     info     The [io.myorg.Globals] import is never referenced  UnusedImport            
  12    warning  Method parameter [args] is never referenced in the method call of class None  UnusedMethodParameter   
  28    info     The statement on line 28 in class None is at the incorrect indent level: Expected one of columns [13, 17, 21] but was 9  Indentation             

/app/vars/updatePipelineMessage.groovy

/app/vars/uploadLogsToAzStorageAccount.groovy

/app/vars/withAzServicePrincipal.groovy


npm-groovy-lint results in 93 linted files:
┌─────────┬───────────┬─────────────┐
│ (index) │ Severity  │ Total found │
├─────────┼───────────┼─────────────┤
│    0    │  'Error'  │      4      │
│    1    │ 'Warning' │     27      │
│    2    │  'Info'   │     165     │
└─────────┴───────────┴─────────────┘
@nvuillam
Copy link
Owner

nvuillam commented Oct 5, 2022

Basically you would like to see in the logs only the files with errors ? :)

nvuillam added a commit that referenced this issue Oct 5, 2022
nvuillam added a commit that referenced this issue Oct 5, 2022
nvuillam added a commit that referenced this issue Oct 6, 2022
* Display all files only with --verbose + defaut failure with info mode

Fixes #243
--failon "info" by default

* cspell

* Fixes + Update test classes

* changelog

* [Mega-Linter] Apply linters fixes

* Fix misc

* fixes ?

* changelog

Co-authored-by: nvuillam <nvuillam@users.noreply.github.com>
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 a pull request may close this issue.

2 participants