-
-
Notifications
You must be signed in to change notification settings - Fork 873
Closed
Labels
awaiting feedbackCannot continue investigating until more information is provided.Cannot continue investigating until more information is provided.bugSomething isn't workingSomething isn't working
Description
Search before asking
- I searched the issues and found no similar issues.
What Happened
When I run diff-quality --violations sqlfluff
I don't see the same violations that I see with sqlfluff lint
I also tried staging and committing the modified file, but that didn't change the results.
~/workspace/transform $ diff-quality --violations sqlfluff
-------------
Diff Quality
Quality Report: sqlfluff
Diff: origin/main...HEAD, staged and unstaged changes
-------------
transform/models/bays/bay_covid/base_cases.sql (100%)
-------------
Total: 1 line
Violations: 0 lines
% Quality: 100%
-------------
~/workspace/transform $ git commit -am "test commit"
[main c7624d2] test commit
1 file changed, 1 insertion(+), 1 deletion(-)
~/workspace/transform $ diff-quality --violations sqlfluff
-------------
Diff Quality
Quality Report: sqlfluff
Diff: origin/main...HEAD, staged and unstaged changes
-------------
transform/models/bays/bay_covid/base_cases.sql (100%)
-------------
Total: 1 line
Violations: 0 lines
% Quality: 100%
-------------
~/workspace/transform $ sqlfluff lint
=== [dbt templater] Sorting Nodes...
=== [dbt templater] Compiling dbt project...
=== [dbt templater] Project Compiled.
== [/config/workspace/transform/models/bays/bay_covid/base_cases.sql] FAIL
L: 9 | P: 5 | L010 | Keywords must be lower case.
All Finished 📜 🎉!
Expected Behaviour
Expected the same violation found with sqlfluff lint
L: 9 | P: 5 | L010 | Keywords must be lower case.
Observed Behaviour
No violation found
-------------
Diff Quality
Quality Report: sqlfluff
Diff: origin/main...HEAD, staged and unstaged changes
-------------
transform/models/bays/bay_covid/base_cases.sql (100%)
-------------
Total: 1 line
Violations: 0 lines
% Quality: 100%
-------------
How to reproduce
Modify a file to make L010 fail and execute diff-quality --violations sqlfluff
Dialect
dialect = snowflake
Version
$ sqlfluff --version
sqlfluff, version 0.11.0
sqlfluff-templater-dbt 0.9.4
$ python --version
Python 3.8.12
$ dbt --version
installed version: 0.21.0
Configuration
.sqlfluff
[sqlfluff]
verbose = 0
nocolor = False
dialect = snowflake
templater = dbt
# rules = None
rules = L001, L003, L005, L010, L012
# rules = L001, L003, L005, L009, L010, L012
project_dir = ./
recurse = 0
output_line_length = 80
runaway_limit = 10
ignore = parsing,templating
ignore_templated_areas = True
# Comma separated list of file extensions to lint.
# NB: This config will only apply in the root folder.
sql_file_exts = .sql,.sql.j2,.dml,.ddl
# Excluding this rule will allow USING
exclude_rules = L032,L044, L030, L031, L034
### OPINIONATED DEFAULTS
# Some rules can be configured directly from the config common to other rules.
[sqlfluff:rules]
tab_space_size = 4
max_line_length = 140
indent_unit = space
comma_style = trailing
allow_scalar = True
single_table_references = unqualified
unquoted_identifiers_policy = all
[sqlfluff:indentation]
indented_joins = False
template_blocks_indent = True
[sqlfluff:templater]
unwrap_wrapped_queries = True
# Some rules have their own specific config.
[sqlfluff:rules:L003]
lint_templated_tokens = True
[sqlfluff:rules:L010] # Keywords
capitalisation_policy = lower
[sqlfluff:rules:L014] # Unquoted identifiers
extended_capitalisation_policy = lower
[sqlfluff:rules:L016]
ignore_comment_lines = False
[sqlfluff:rules:L029] # Keyword identifiers
unquoted_identifiers_policy = none
[sqlfluff:rules:L030] # Function names
capitalisation_policy = lower
[sqlfluff:rules:L038]
select_clause_trailing_comma = forbid
[sqlfluff:rules:L040] # Null & Boolean Literals
capitalisation_policy = lower
[sqlfluff:rules:L042]
# By default, allow subqueries in from clauses, but not join clauses.
forbid_subquery_in = join
[sqlfluff:rules:L047] # Consistent syntax to count all rows
prefer_count_1 = False
.sqlfluffignore
target/
dbt_modules/
macros/
templates/
Are you willing to work on and submit a PR to address the issue?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
awaiting feedbackCannot continue investigating until more information is provided.Cannot continue investigating until more information is provided.bugSomething isn't workingSomething isn't working