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
src/sqlfluff/core/linter: Improve ignore file processing #1650
src/sqlfluff/core/linter: Improve ignore file processing #1650
Conversation
CyberShadow
commented
Oct 14, 2021
- Don't re-scan entire directories for every sqlfluffignore
- Fix crashes due to recursive symlinks
- Improve warning when an exact file is ignored
- Fixes Creating a .sqlfluffignore causes SQLFluff to crash if symlinks are present #1646
Codecov Report
@@ Coverage Diff @@
## main #1650 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 133 133
Lines 9250 9251 +1
=========================================
+ Hits 9250 9251 +1
Continue to review full report at Codecov.
|
207dd43
to
29c21b9
Compare
27d1610
to
29c21b9
Compare
- Don't re-scan entire directories for every sqlfluffignore - Fix crashes due to recursive symlinks - Improve warning when an exact file is ignored
29c21b9
to
e359f25
Compare
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.
Thanks for putting this together. The only thing I'm not sure about is the significance of the path_c
file that you've added - what is it's function?
@@ -0,0 +1 @@ | |||
. |
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.
@CyberShadow - what's the significance of this file?
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.
It is the test case. (It's a symlink, but that's not visible on GitHub.)
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.
Ahhhhhh. Makes sense. I'm on a windows machine so symlinks don't display properly :)
linter_logger.warning( | ||
"Exact file path %s was given but " | ||
"it was ignored by a %s pattern in %s, " | ||
"re-run with `--disregard-sqlfluffignores` to " | ||
"skip %s" | ||
% ( | ||
path, | ||
ignore_file_name, | ||
ignore_base, | ||
ignore_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.
Nice 👍
Co-authored-by: Alan Cruickshank <alanmcruickshank@gmail.com>