Skip to content

Commit e7c6c45

Browse files
authored
Merge pull request #18 from georgetown-cset/bump-pre-commits
Bump pre commits & lint
2 parents 6fbfbb4 + eecb016 commit e7c6c45

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,29 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.1.0
5+
rev: v6.0.0
66
hooks:
77
- id: trailing-whitespace
88
exclude: "__snapshots__"
99
- id: end-of-file-fixer
1010
- id: check-yaml
1111
- id: check-added-large-files
1212
- id: check-json
13-
# The next step only applies if you have javascript files.
14-
# There should be a package.json that installs eslint
15-
# (or eslint-config-react-app if you are using gatsby).
16-
# - repo: https://github.com/pre-commit/mirrors-eslint
17-
# rev: v8.24.0
18-
# hooks:
19-
# - id: eslint
2013
- repo: https://github.com/PyCQA/isort
21-
rev: 5.11.5
14+
rev: 6.0.1
2215
hooks:
2316
- id: isort
2417
- repo: https://github.com/ambv/black
25-
rev: 22.3.0
18+
rev: 25.9.0
2619
hooks:
2720
- id: black
2821
language_version: python3
2922
- repo: https://github.com/PyCQA/flake8
30-
rev: 7.1.0
23+
rev: 7.3.0
3124
hooks:
3225
- id: flake8
3326
- repo: https://github.com/sqlfluff/sqlfluff
34-
rev: 0.10.1
27+
rev: 3.4.2
3528
hooks:
3629
- id: sqlfluff-lint
3730
- id: sqlfluff-fix

.sqlfluff

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
[sqlfluff]
22
dialect=bigquery
33
indent_unit = space
4-
exclude_rules = L014,L018,L027,L032,L034,L042,L044
4+
exclude_rules = L014,L018,L027,L032,L034,L042,L044,RF01,CV03,RF04
5+
max_line_length = 120
56

67
[sqlfluff:rules]
78
max_line_length = 120
89
tab_space_size = 2
910

10-
[sqlfluff:rules:L010]
11+
[sqlfluff:rules:capitalisation.keywords]
1112
capitalisation_policy = upper
1213

13-
[sqlfluff:rules:L030]
14-
extended_capitalisation_policy = upper
14+
[sqlfluff:rules:capitalisation.functions]
15+
capitalisation_policy = lower
16+
17+
[sqlfluff:rules:convention.quoted_literals]
18+
preferred_quoted_literal_style = double_quotes
1519

1620
[sqlfluff:templater:jinja:context]
1721
params = {"staging_dataset": "staging_airtable_to_bq", "production_dataset": "airtable_pipeline_demos", "staging_table_name": "base1_table1", "production_table_name": "base1_table1"}

airtable_to_bq.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ def update_staging(dag: DAG, start_task, config: dict):
102102
params={
103103
"staging_dataset": STAGING_DATASET,
104104
"production_dataset": config["production_dataset"],
105-
"staging_table_name": new_table
106-
if config.get("new_query")
107-
else raw_table,
105+
"staging_table_name": (
106+
new_table if config.get("new_query") else raw_table
107+
),
108108
"production_table_name": config["production_table"],
109109
},
110110
)

examples/sql/base1_table1_new.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
SELECT * FROM {{ params.staging_dataset }}.{{ params.staging_table_name }} WHERE foo IS NOT NULL
1+
SELECT *
2+
FROM {{ params.staging_dataset }}.{{ params.staging_table_name }}
3+
WHERE foo IS NOT NULL

examples/sql/base1_table2_new.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
SELECT * FROM {{ params.staging_dataset }}.{{ params.staging_table_name }} WHERE length(some_notes) > 20
1+
SELECT *
2+
FROM {{ params.staging_dataset }}.{{ params.staging_table_name }}
3+
WHERE length(some_notes) > 20

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[tool.black]
2-
py36 = true
32
include = '\.pyi?$'
43
exclude = '''
54
/(

0 commit comments

Comments
 (0)