Skip to content

Commit a5e0f21

Browse files
committed
chore: Update ruff lint configuration
1 parent 8169962 commit a5e0f21

10 files changed

+73
-61
lines changed

component_setup_usability.ipynb

+8-5
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@
9191
"\n",
9292
"def get_indicators_dictionary(fields_list):\n",
9393
" \"\"\"\n",
94-
" Some indicators can use alternative fields. For example, the number of tenderers can use either\n",
95-
" `tender/numberOfTenderers` or `tender/tenderers/id`. This section checks which fields are available.\n",
94+
" Check which alternative fields are available for indicators.\n",
95+
"\n",
96+
" For example, the number of tenderers can use either `tender/numberOfTenderers` or `tender/tenderers/id`.\n",
9697
" \"\"\"\n",
9798
" # U002\n",
9899
" buyer = [\"buyer/name\", \"buyer/id\"]\n",
@@ -514,10 +515,12 @@
514515
"\n",
515516
"\n",
516517
"def usability_checks(fields_list, indicators_dic):\n",
517-
" \"\"\"Returns a table of the usability checks.\n",
518-
" It indicates if the fields needed to calculate a particular indicator are present.\n",
519-
" Set check_coverage=True to check for coverage\"\"\"\n",
518+
" \"\"\"\n",
519+
" Return a table of the usability checks.\n",
520520
"\n",
521+
" It indicates if the fields needed to calculate a particular indicator are present.\n",
522+
" Set check_coverage=True to check for coverage.\n",
523+
" \"\"\"\n",
521524
" results_list = []\n",
522525
" missing_fields = []\n",
523526
"\n",

manage.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ def yield_cells(notebook):
132132
continue
133133

134134
sql = "".join(source[1:])
135-
pg_format = subprocess.run(
136-
["pg_format", "-f", "1"],
135+
pg_format = subprocess.run( # noqa: S603 # trusted input
136+
["pg_format", "-f", "1"], # noqa: S607
137137
input=sql,
138138
stdout=subprocess.PIPE,
139139
check=True,
@@ -163,9 +163,7 @@ def json_dump(path, notebook):
163163
@click.command()
164164
@click.argument("filename", nargs=-1, type=click.Path(exists=True, dir_okay=False, path_type=Path))
165165
def pre_commit(filename):
166-
"""
167-
Format SQL cells in Jupyter Notebooks using pg_format and merge components to build notebooks.
168-
"""
166+
"""Format SQL cells in Jupyter Notebooks using pg_format and merge components to build notebooks."""
169167
resolved = [path.resolve() for path in filename]
170168

171169
for _, filepath, notebook in yield_notebooks():

pyproject.toml

+6-16
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,15 @@ extend-include = ["*.ipynb"]
1313
[tool.ruff.lint]
1414
select = ["ALL"]
1515
ignore = [
16-
"ANN", "COM", "EM",
17-
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
18-
"W191", "D206", "Q000", "Q001", "Q002", "Q003", "ISC001",
19-
"D", # pydocstyle
20-
"C901", "PLR091", # complexity preferences
21-
"ARG001", # https://github.com/astral-sh/ruff/issues/8094
22-
"B018", # useless expression (e.g. variable to render)
23-
"E402", # import not at top
24-
"ERA001", # commented-out code
25-
"F401", # imported but unused
26-
"F821", # undefined name (e.g. %sql magic assignment)
27-
"F841", # https://github.com/astral-sh/ruff/issues/8094
28-
"S603", # subprocess "execution of untrusted input"
29-
"S607", # subprocess "with a partial executable path"
16+
"ANN", "C901", "COM812", "D203", "D212", "D415", "EM", "ISC001", "PERF203", "PLR091", "Q000",
17+
"D1",
18+
"ERA001", # commented-out code
3019
]
3120

32-
[tool.ruff.lint.flake8-builtins]
33-
builtins-ignorelist = ["copyright"]
21+
[tool.ruff.lint.flake8-unused-arguments]
22+
ignore-variadic-names = true
3423

3524
[tool.ruff.lint.per-file-ignores]
3625
"component_*" = ["F821"]
3726
"template_*" = ["E501", "F401"]
27+
"*.ipynb" = ["ARG001"] # $file_name

template_basic_criteria_checks.ipynb

+8-5
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,9 @@
487487
"\n",
488488
"def get_indicators_dictionary(fields_list):\n",
489489
" \"\"\"\n",
490-
" Some indicators can use alternative fields. For example, the number of tenderers can use either\n",
491-
" `tender/numberOfTenderers` or `tender/tenderers/id`. This section checks which fields are available.\n",
490+
" Check which alternative fields are available for indicators.\n",
491+
"\n",
492+
" For example, the number of tenderers can use either `tender/numberOfTenderers` or `tender/tenderers/id`.\n",
492493
" \"\"\"\n",
493494
" # U002\n",
494495
" buyer = [\"buyer/name\", \"buyer/id\"]\n",
@@ -910,10 +911,12 @@
910911
"\n",
911912
"\n",
912913
"def usability_checks(fields_list, indicators_dic):\n",
913-
" \"\"\"Returns a table of the usability checks.\n",
914-
" It indicates if the fields needed to calculate a particular indicator are present.\n",
915-
" Set check_coverage=True to check for coverage\"\"\"\n",
914+
" \"\"\"\n",
915+
" Return a table of the usability checks.\n",
916916
"\n",
917+
" It indicates if the fields needed to calculate a particular indicator are present.\n",
918+
" Set check_coverage=True to check for coverage.\n",
919+
" \"\"\"\n",
917920
" results_list = []\n",
918921
" missing_fields = []\n",
919922
"\n",

template_relevant_checks_fieldlist.ipynb

+8-5
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,9 @@
259259
"\n",
260260
"def get_indicators_dictionary(fields_list):\n",
261261
" \"\"\"\n",
262-
" Some indicators can use alternative fields. For example, the number of tenderers can use either\n",
263-
" `tender/numberOfTenderers` or `tender/tenderers/id`. This section checks which fields are available.\n",
262+
" Check which alternative fields are available for indicators.\n",
263+
"\n",
264+
" For example, the number of tenderers can use either `tender/numberOfTenderers` or `tender/tenderers/id`.\n",
264265
" \"\"\"\n",
265266
" # U002\n",
266267
" buyer = [\"buyer/name\", \"buyer/id\"]\n",
@@ -682,10 +683,12 @@
682683
"\n",
683684
"\n",
684685
"def usability_checks(fields_list, indicators_dic):\n",
685-
" \"\"\"Returns a table of the usability checks.\n",
686-
" It indicates if the fields needed to calculate a particular indicator are present.\n",
687-
" Set check_coverage=True to check for coverage\"\"\"\n",
686+
" \"\"\"\n",
687+
" Return a table of the usability checks.\n",
688688
"\n",
689+
" It indicates if the fields needed to calculate a particular indicator are present.\n",
690+
" Set check_coverage=True to check for coverage.\n",
691+
" \"\"\"\n",
689692
" results_list = []\n",
690693
" missing_fields = []\n",
691694
"\n",

template_relevant_checks_registry.ipynb

+8-5
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,9 @@
239239
"\n",
240240
"def get_indicators_dictionary(fields_list):\n",
241241
" \"\"\"\n",
242-
" Some indicators can use alternative fields. For example, the number of tenderers can use either\n",
243-
" `tender/numberOfTenderers` or `tender/tenderers/id`. This section checks which fields are available.\n",
242+
" Check which alternative fields are available for indicators.\n",
243+
"\n",
244+
" For example, the number of tenderers can use either `tender/numberOfTenderers` or `tender/tenderers/id`.\n",
244245
" \"\"\"\n",
245246
" # U002\n",
246247
" buyer = [\"buyer/name\", \"buyer/id\"]\n",
@@ -662,10 +663,12 @@
662663
"\n",
663664
"\n",
664665
"def usability_checks(fields_list, indicators_dic):\n",
665-
" \"\"\"Returns a table of the usability checks.\n",
666-
" It indicates if the fields needed to calculate a particular indicator are present.\n",
667-
" Set check_coverage=True to check for coverage\"\"\"\n",
666+
" \"\"\"\n",
667+
" Return a table of the usability checks.\n",
668668
"\n",
669+
" It indicates if the fields needed to calculate a particular indicator are present.\n",
670+
" Set check_coverage=True to check for coverage.\n",
671+
" \"\"\"\n",
669672
" results_list = []\n",
670673
" missing_fields = []\n",
671674
"\n",

template_relevant_checks_registry_all.ipynb

+8-5
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,9 @@
239239
"\n",
240240
"def get_indicators_dictionary(fields_list):\n",
241241
" \"\"\"\n",
242-
" Some indicators can use alternative fields. For example, the number of tenderers can use either\n",
243-
" `tender/numberOfTenderers` or `tender/tenderers/id`. This section checks which fields are available.\n",
242+
" Check which alternative fields are available for indicators.\n",
243+
"\n",
244+
" For example, the number of tenderers can use either `tender/numberOfTenderers` or `tender/tenderers/id`.\n",
244245
" \"\"\"\n",
245246
" # U002\n",
246247
" buyer = [\"buyer/name\", \"buyer/id\"]\n",
@@ -662,10 +663,12 @@
662663
"\n",
663664
"\n",
664665
"def usability_checks(fields_list, indicators_dic):\n",
665-
" \"\"\"Returns a table of the usability checks.\n",
666-
" It indicates if the fields needed to calculate a particular indicator are present.\n",
667-
" Set check_coverage=True to check for coverage\"\"\"\n",
666+
" \"\"\"\n",
667+
" Return a table of the usability checks.\n",
668668
"\n",
669+
" It indicates if the fields needed to calculate a particular indicator are present.\n",
670+
" Set check_coverage=True to check for coverage.\n",
671+
" \"\"\"\n",
669672
" results_list = []\n",
670673
" missing_fields = []\n",
671674
"\n",

template_usability_checks.ipynb

+8-5
Original file line numberDiff line numberDiff line change
@@ -1022,8 +1022,9 @@
10221022
"\n",
10231023
"def get_indicators_dictionary(fields_list):\n",
10241024
" \"\"\"\n",
1025-
" Some indicators can use alternative fields. For example, the number of tenderers can use either\n",
1026-
" `tender/numberOfTenderers` or `tender/tenderers/id`. This section checks which fields are available.\n",
1025+
" Check which alternative fields are available for indicators.\n",
1026+
"\n",
1027+
" For example, the number of tenderers can use either `tender/numberOfTenderers` or `tender/tenderers/id`.\n",
10271028
" \"\"\"\n",
10281029
" # U002\n",
10291030
" buyer = [\"buyer/name\", \"buyer/id\"]\n",
@@ -1445,10 +1446,12 @@
14451446
"\n",
14461447
"\n",
14471448
"def usability_checks(fields_list, indicators_dic):\n",
1448-
" \"\"\"Returns a table of the usability checks.\n",
1449-
" It indicates if the fields needed to calculate a particular indicator are present.\n",
1450-
" Set check_coverage=True to check for coverage\"\"\"\n",
1449+
" \"\"\"\n",
1450+
" Return a table of the usability checks.\n",
14511451
"\n",
1452+
" It indicates if the fields needed to calculate a particular indicator are present.\n",
1453+
" Set check_coverage=True to check for coverage.\n",
1454+
" \"\"\"\n",
14521455
" results_list = []\n",
14531456
" missing_fields = []\n",
14541457
"\n",

template_usability_checks_fieldlist.ipynb

+8-5
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,9 @@
560560
"\n",
561561
"def get_indicators_dictionary(fields_list):\n",
562562
" \"\"\"\n",
563-
" Some indicators can use alternative fields. For example, the number of tenderers can use either\n",
564-
" `tender/numberOfTenderers` or `tender/tenderers/id`. This section checks which fields are available.\n",
563+
" Check which alternative fields are available for indicators.\n",
564+
"\n",
565+
" For example, the number of tenderers can use either `tender/numberOfTenderers` or `tender/tenderers/id`.\n",
565566
" \"\"\"\n",
566567
" # U002\n",
567568
" buyer = [\"buyer/name\", \"buyer/id\"]\n",
@@ -983,10 +984,12 @@
983984
"\n",
984985
"\n",
985986
"def usability_checks(fields_list, indicators_dic):\n",
986-
" \"\"\"Returns a table of the usability checks.\n",
987-
" It indicates if the fields needed to calculate a particular indicator are present.\n",
988-
" Set check_coverage=True to check for coverage\"\"\"\n",
987+
" \"\"\"\n",
988+
" Return a table of the usability checks.\n",
989989
"\n",
990+
" It indicates if the fields needed to calculate a particular indicator are present.\n",
991+
" Set check_coverage=True to check for coverage.\n",
992+
" \"\"\"\n",
990993
" results_list = []\n",
991994
" missing_fields = []\n",
992995
"\n",

template_usability_checks_registry.ipynb

+8-5
Original file line numberDiff line numberDiff line change
@@ -679,8 +679,9 @@
679679
"\n",
680680
"def get_indicators_dictionary(fields_list):\n",
681681
" \"\"\"\n",
682-
" Some indicators can use alternative fields. For example, the number of tenderers can use either\n",
683-
" `tender/numberOfTenderers` or `tender/tenderers/id`. This section checks which fields are available.\n",
682+
" Check which alternative fields are available for indicators.\n",
683+
"\n",
684+
" For example, the number of tenderers can use either `tender/numberOfTenderers` or `tender/tenderers/id`.\n",
684685
" \"\"\"\n",
685686
" # U002\n",
686687
" buyer = [\"buyer/name\", \"buyer/id\"]\n",
@@ -1102,10 +1103,12 @@
11021103
"\n",
11031104
"\n",
11041105
"def usability_checks(fields_list, indicators_dic):\n",
1105-
" \"\"\"Returns a table of the usability checks.\n",
1106-
" It indicates if the fields needed to calculate a particular indicator are present.\n",
1107-
" Set check_coverage=True to check for coverage\"\"\"\n",
1106+
" \"\"\"\n",
1107+
" Return a table of the usability checks.\n",
11081108
"\n",
1109+
" It indicates if the fields needed to calculate a particular indicator are present.\n",
1110+
" Set check_coverage=True to check for coverage.\n",
1111+
" \"\"\"\n",
11091112
" results_list = []\n",
11101113
" missing_fields = []\n",
11111114
"\n",

0 commit comments

Comments
 (0)