Skip to content

Commit 793b382

Browse files
committed
CI: Improve CodeQL exclude rule configuration
1 parent 40a4a15 commit 793b382

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

.github/codeql.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
1+
# Suppress some CodeQL warnings.
12
query-filters:
23

3-
# Suppress some LGTM warnings.
4-
4+
# A few occurrences of try/except clauses without naming a specific exception type.
5+
# TODO: May be improved.
6+
# https://codeql.github.com/codeql-query-help/python/py-empty-except/
57
- exclude:
68
id: py/empty-except
79

810
# A module is imported with the "import" and "import from" statements.
9-
# https://lgtm.com/rules/1818040193/
11+
# CodeQL says "Importing a module twice using the import xxx and from xxx import yyy is confusing.".
12+
# While it has a point, it is still more than acceptable.
13+
# https://codeql.github.com/codeql-query-help/python/py-import-and-import-from/
1014
- exclude:
1115
id: py/import-and-import-from
1216

17+
# Quite a few functions don't explicitly return values, but
18+
# instead implicitly return `None`, when falling through.
19+
# TODO: May be improved.
20+
# https://codeql.github.com/codeql-query-help/python/py-mixed-returns/
1321
- exclude:
1422
id: py/mixed-returns
1523

16-
# Disable rule to compensate parameter naming in `CrateCompiler._get_crud_params`.
17-
# Using an alternative name for the first parameter of an instance method makes code more difficult to read.
18-
# https://lgtm.com/rules/910082/
24+
# The parameter naming in `CrateCompiler._get_crud_params` is so that it triggers this admonition.
25+
# However, by using an alternative name for the first parameter of an instance method, it would
26+
# make the code harder to read.
27+
# https://codeql.github.com/codeql-query-help/python/py-not-named-self/
1928
- exclude:
2029
id: py/not-named-self
2130

31+
# A few occurrences of unused local variables.
32+
# TODO: May be improved.
33+
# https://codeql.github.com/codeql-query-help/python/py-unused-local-variable/
2234
- exclude:
2335
id: py/unused-local-variable

0 commit comments

Comments
 (0)