Git Product home page Git Product logo

Comments (4)

TommyE123 avatar TommyE123 commented on August 17, 2024 1

Hi @NadaMusthafa,

I’ve taken a look into this for you and have found a few problems with config files and paths both in csharpier and megalinter itself.

Taking megalinter out of the equation for a moment, running csharpier manually locally produces these results.

I’ve increased the indent to 8 spaces in the .editorconfig and .csharpierrc for testing purposes.
image

  1. .editorconfig only in the root of the directory ✅
  2. .csharpierrc only in the root of the directory ✅
  3. .csharpierrc in a config folder and use -config-path to point to it ✅
  4. .editorconfig in a config folder and use -config-path to point to it ❌
  5. .editorconfig in root and use --config-path to point to it ❌

This strongly suggests that csharpier doesn’t support using the --config-path to point to a .editorconfig. This would require logging an issue with csharpier directly if you don’t want to put an .editorconfig in the root of your code. However its widely recognised as standard practice to place this type of file in the root, hence why I guess they probably don’t support it.

However while doing some testing for this issue I noticed that megalinter doesn’t work when overriding the configuration file name or path for a .csharpierrc file. I’ve created a PR for this here #3664

Hope this helps,
Tom

from megalinter.

nvuillam avatar nvuillam commented on August 17, 2024

@NadaMusthafa please could you share an example of call to CSharpier with config file, so we can add its management in MegaLinter ?

from megalinter.

creativehub2000 avatar creativehub2000 commented on August 17, 2024

We used the following Settings:

Docker Image (latest): oxsecurity/megalinter-only-csharp_csharpier:beta_20240508-1708

Environment variables:

For MegaLinter:
MEGALINTER_FILES_TO_LINT : <list_of_comma_seperated_C#_files>
ENABLE_LINTERS : CSHARP_CSHARPIER
AZURE_COMMENT_REPORTER : false

For CSharpier:
CSHARP_CSHARPIER_CONFIG_FILE : '/config/.editorconfig'
CSHARP_CSHARPIER_CLI_LINT_MODE : list_of_files

With this basic setting, CSharpier throws an exception as shown.

megalinter_issue

from megalinter.

github-actions avatar github-actions commented on August 17, 2024

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

from megalinter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.