-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
Support Auto-Fix with Sqlfluff #2784
Comments
@BrunoJuchli thanks for the analysis and propositions :) When sqlfluff is called with There are ways to replace lint by fix just in descripto but replacing the cli_lint_mode could be done only in a Python class associates to the linter descriptor, something like in overridden method before_lint_files if self.apply_fixes is True:
self.cli_lint_mode = file Would you like to make a PR ? :) |
@nvuillam re whether
However, not sure if it actually works. At least for a specific scenario it seems to fail to report linting errors: sqlfluff/sqlfluff#4871 Re providing a PR: last time I worked with python was more than 10 years ago... so I fear it might take me quite long => I don't want my boss to get out his Kloppe ;-) |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
@BrunoJuchli I learnt python to build MegaLinter, the code is simple :p And i'll help if necessary :) |
@nvuillam I am unsure if it is related to the reported problem, but |
@P107RP today |
@nvuillam I think it is a very handy feature ;) |
I have a crazy backlog, not only on MegaLinter, so i'll probably do it someday but that might be not soon ^^ If someone submits a PR I'll be glad to accept it :) |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
The issue went stale but any chance this will get implemented soon? |
It depends on if a generous contributor wants to spent some time on it to submit a PR :) |
Problem
Currently megalinter Sqlfluff integration does not support fixing of files.
I have tried different combinations, like:
passing
fix
as argument=> Error says
fix
is not a valid file pathreconfiguring executable
=> Error says 'lint' is not a valid file path
Proposed Solution
Use the standard way of applying auto-fixes, by either:
-adding 'SQL_SQLFLUFF ' to 'APPLY_FIXES'
-setting 'APPLY_FIXES' to 'all'
When auto-fixing is enabled, the following should happen:
file
(sqlfluff fix
only supports a single file or folder path as argument)Alternative Configurability
Add a new configurable variable
SQL_SQLFLUFF_FIX
with a default value of 'false'.The text was updated successfully, but these errors were encountered: