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
Check _RULES_PATH for active_only_if_file_found check #418
Check _RULES_PATH for active_only_if_file_found check #418
Conversation
First contribution, saw an issue that I am also running into so wanted to try and submit a fix! My concern is mostly around the 2nd commit where i am appending the Marked as draft to make sure this is ok before merging |
Also looks like the linter is failing in a file I did not modify, should I fix as a part of this PR or is it not something to worry about? |
Codecov Report
@@ Coverage Diff @@
## master #418 +/- ##
==========================================
+ Coverage 86.70% 87.64% +0.93%
==========================================
Files 126 126
Lines 2934 2937 +3
==========================================
+ Hits 2544 2574 +30
+ Misses 390 363 -27
Continue to review full report at Codecov.
|
Sorry for the delay, i'll have a look asap :) |
Please can you try to merge master in your branch ?
Thanks :) |
@nvuillam Updated! |
@omusavi CI is not happy... i think I know why :) |
Sorry I am not sure I understand what you mean. I don't think I replaced any checks, in the code in the image above I just prepended the workspace path to the linter rules path which is a workaround to get it working locally. I guess I am a bit confused about the CWD in these cases (also called out in #419), are we expecting |
@omusavi yes github/linters must be in workspace root :) Basically, let the elif in red like it was before, and add an elif before with the code in green, and that should do the trick :) |
Ok I still do not completed understand under what scenarios the file at Added the change as you directed and it looks like CI is happy, so this is just for my own knowledge! |
@@ -326,7 +329,8 @@ def load_config_vars(self): | |||
# 1: http rules path: fetch remove file and copy it locally (then delete it after linting) | |||
# 2: repo + config_file_name | |||
# 3: linter_rules_path + config_file_name | |||
# 4: mega-linter default rules path + config_file_name | |||
# 4: workspace root + linter_rules_path + config_file_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just want to confirm this is the correct interpretation here...
Probably in MegaLinter own test classes :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for your contribution :)
Currently, active_only_if_file_found only checks the root workspace folder for the required files. These files may not always be present at the root, especially in a monorepo scenario. By looking in the
_RULES_PATH
folder, we can enable these linters to run as expected.Fixes #374
Proposed Changes
config_file
andlinter_rules_path
is set, make it relative toself.workspace
(might only be required for local execution where CWD is/
)Readiness Checklist
Author/Contributor
Reviewing Maintainer
breaking
if this is a large fundamental changeautomation
,bug
,documentation
,enhancement
,infrastructure
, orperformance