-
Notifications
You must be signed in to change notification settings - Fork 485
/
.lgtm.yml
52 lines (49 loc) · 2 KB
/
.lgtm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
path_classifiers:
docs:
- scripts/generate_command_help.py
test:
# Mark all code under the src/ directory as test related.
# Really, the crc analyzer is not for test, but LGTM can't build embedded.
- src
- exclude: src/analyzer
queries:
# Exclude warning about 'if' or 'while' statements that have an 'else' clause, when there is not
# a 'break' statement within the main statement body (ie, it uses a 'return' to exit). This style
# is used in some places in pyocd to reflect that the 'else' body is logically part of the main
# statement. In particular, the Timeout class is used in this pattern:
#
# with Timeout(TIMEOUT) as t:
# while t.check():
# # code...
# else:
# # handle timeout...
#
# In some cases the 'while' block will exit with only a 'return', so the 'else' isn't really
# necessary, but retaining it maintains the expected pattern.
- exclude: "py/redundant-else"
# Exclude cases where there is an import of the same module via 'import foo' and 'from foo import ...'.
# The query for this is too general and catches a lot of cases that are not really errors, especially
# with includes of types for annotations.
#
# Example 1:
#
# import pyocd
# from pyocd import debug
#
# These two imports trigger this query, even though it's pretty clearly a reasonable usage.
#
# Example 2:
#
# if TYPE_CHECKING:
# import types
#
# def foo():
# import types
#
# In this case, types is only needed within foo() at runtime and is not imported globally to reduce
# namespace pollution and import times. But when type checking it's types is also imported. The query
# doesn't see the TYPE_CHECKING predicate and triggers.
- exclude: "py/import-and-import-from"
# This query triggers on logging of the probe's UID as specified on the command line in cleartext.
# Clearly the UID is not sensitive data, at least in the traditional sense.
- exclude: "py/clear-text-logging-sensitive-data"