Coder Social home page Coder Social logo

Comments (7)

nvuillam avatar nvuillam commented on June 14, 2024 2

@schorlton @wesley-dean-flexion I have an idea, I hope it will work ;)

https://github.com/oxsecurity/megalinter/pull/3409/files

from megalinter.

wesley-dean-flexion avatar wesley-dean-flexion commented on June 14, 2024

@schorlton

https://megalinter.io/latest/descriptors/spell_vale/

To be active within MegaLinter, you need to initialize a .vale.ini configuration file at the root of your repository.

So, that behavior you're seeing makes sense.

That said, why wouldn't SPELL_VALE_CONFIG_FILE pointing to a different location also change that behavior? That's... a good question. I'll look into it and comment back; I just wanted to get something back to you as quickly as possible so as to hopefully unblock you.

from megalinter.

wesley-dean-flexion avatar wesley-dean-flexion commented on June 14, 2024

https://github.com/oxsecurity/megalinter/blob/main/megalinter/descriptors/spell.megalinter-descriptor.yml#L96

from megalinter.

wesley-dean-flexion avatar wesley-dean-flexion commented on June 14, 2024

@schorlton a couple of thoughts:

  1. I don't know if active_only_if_file_found can accept an extended glob (**/*/.vale.ini) or a regex (\.vale\.ini$) or something like that, so if Vale's only going to run when there's a .vale.ini somewhere, I don't know how to have Megalinter look in multiple locations for it
  2. running the Vale container without a configuration file causes Vale to throw an error, so allowing Vale to run when there isn't a config file somewhere where it's looking will cause Vale to throw an error.
E100 [.vale.ini not found] Runtime error

no config file found

Execution stopped with code 1.

I don't think we want Vale to run and fail unnecessarily (I don't think most people use it, actually) so unless there's a way to have that active_only_if_file_found to respect the SPELL_VALE_CONFIG_FILE parameter, I'm not sure how to proceed.

Would having a symlink from wherever the config file actually lives point back to the project root work? (e.g., ln -s "path/to/real/.vale.ini" "$(git rev-parse --show-toplevel)/.vale.ini"). If you're stuck having the actual config file reside in a location that's not the project root, that might help get you there.

In my humble opinion, having the active_only_if_file_found respect the SPELL_VALE_CONFIG_FILE parameter would be the best solution; however, if Megalinter doesn't currently do that -- regardless of how complicated the logic to support it may be -- I don't know if there would be a sufficient return on that investment.. then again, it's not my call.

Someone with more familiarity into that check works may be able to provide more insight.

Sorry... that's all I've got at the moment.

from megalinter.

wesley-dean-flexion avatar wesley-dean-flexion commented on June 14, 2024

Maybe we should remove that SPELL_VALE_CONFIG_FILE parameter so as to reduce potential confusion. 🀷

from megalinter.

schorlton avatar schorlton commented on June 14, 2024

Thanks @wesley-dean-flexion for the quick response! That was my best guess as well - the config should be removed if not possible to make it work or maybe there is some clever solution by the megalinter team. Putting linter configs in a dedicated folder is a practice we are trying to follow for repo organization...putting all of our (mega)linter configs in the root of the repo would increase clutter but is doable if needed.

from megalinter.

nvuillam avatar nvuillam commented on June 14, 2024

@schorlton please can you check with MegaLinter beta version ?

Now if SPELL_VALE_CONFIG_FILE is defined, its value will be checked to define if the linter must be activated or not

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.