-
Notifications
You must be signed in to change notification settings - Fork 218
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
MegaLinter config brush ups #1994
Comments
Excellent list, thanks @eitsupi ! Unless anyone objects, I'm not sure we really need the "Needs Discussion" — we could go and do these things (but totally fine to leave it there and see if anyone does) |
Indeed, you need to decide which linters are relevant for PRQL and which are not :)
The second part can be done progressively of course ! |
About APPLY_FIXES, even if you don't activate the function to add a new commit, you can copy-paste the fixed files from the artifacts, and it will decrease the errors triggered by formatters/linters that can autofix ^^ |
Thank you for the detailed explanation, @nvuillam! As @nvuillam explained, we need to decide which linter to elevate from a warning to an error, etc. |
I'm happy to review them, it's fine to add things and then remove them later if they turn out to be a net negative. Folks should feel free to try adding them if they think it might be helpful. My standard criteria — either it should:
Clippy doesn't quite fit into these, but is close enough to the second to be OK |
With MegaLinter auto fix enabled, commits made with GitHub Actions do not trigger the GitHub Actions workflow under normal permissions, so it is likely that the tests required for merging will not be performed after the autofix commit is made. |
@eitsupi this is a github limitation -> https://github.com/orgs/community/discussions/27146 But it can be solvevd with a PAT, indeed :) |
@nvuillam Thanks for your reply. Of course I understand that is a general limitation of GitHub Actions. I simply do not have permission to set an access token for this repository. |
I understand :) Or you may just add a commit locally to trigger again the workflow, instead of creating a new PR |
( or just comment the part where the commit is done, and people could go in artifacts to get the updated sources and copy-paste them in their repo then push a new commit) |
FYI we already the PAT for backporting, so we can experiment with this by using I definitely think it's important that the tests run automatically, otherwise it's quite confusing — it's maybe OK if it's just one of us, but new contributors are not going to know to open & close the PR. |
We can also move the workflow into Though I do notice the workflow is extremely verbose. @nvuillam I wonder whether you might consider encapsulating some of that within an action? |
@max-sixty the autofix can be performed with pre-made actions in all CI platforms, that's why we decided to not rebuild the wheel |
Totally agree! I was thinking that the thing that users paste into their workflow files could instead be in MegaLinter's # Push new commit if applicable (for now works only on PR from same repository, not from forks)
- name: Prepare commit
if:
steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT ==
'all' || env.APPLY_FIXES_EVENT == github.event_name) &&
env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' &&
(github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository)
run: sudo chown -Rc $UID .git/
- name: Commit and push applied linter fixes
if:
steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT ==
'all' || env.APPLY_FIXES_EVENT == github.event_name) &&
env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' &&
(github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository)
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch:
${{ github.event.pull_request.head.ref || github.head_ref ||
github.ref }}
commit_message: "[MegaLinter] Apply linters fixes" |
These parts are not supposed to be updated anytime soon, they are quite standard, the updates are usually within MegaLinter core docker image :) |
Given that @max-sixty Thoughts? |
We have set up a CI workflow of MegaLinter in #1974, but the current setup is very rough.
Need to follow up based on some future feedback.
A list of some things to do:
TODO
The text was updated successfully, but these errors were encountered: