oxsecurity / megalinter

🦙 MegaLinter analyzes 50 languages, 22 formats, 21 tooling formats, excessive copy-pastes, spelling mistakes and security issues in your repository sources with a GitHub Action, other CI tools or locally.
https://megalinter.io
GNU Affero General Public License v3.0
1.8k stars 215 forks source link

enhancement: CSharpier config filename and path override ability #3664

Closed TommyE123 closed 2 weeks ago

TommyE123 commented 2 weeks ago

Fixes #3553

CSharpier - Filename and path override improvements

This change adds the ability to override the location of the .csharpierrc filename and path. Currently its using the default option for the command -c which is incorrect and requires --config-path csharpier documentation. This also now allows the .csharpierrc file to be placed in the default linter path which currently doesn't work due to the wrong command parameter.

Please note this doesn't allow an .editorconfig to work in another location as this isnt currently supported by csharpier. (see issue 3553 for more info) However if this changes then the fix should also work nicely with this approach as well.

Proposed Changes

  1. Fixed config path option command.
  2. Added default file name .csharpierrc.
  3. Updated schema to reflext the 2 new available options avaiable. (assumed this was required but please say if this isn't or I need to update anything else?)

Testing - Mixture of CI builds to demonstrate the fix

GITLAB - Both filename and location overridden: image image

GITLAB - .csharpierrc in default Linter rules location: image

AZURE - Filename overridden .csharpierrc.yml in default Linter rules location: image image

GITHUB - Filename .csharpierrc.yml in root (no extra megalinter parameters set): image