Skip to content

Commit 4d97f97

Browse files
authored
Disable warnings related to the use of assert in the tests directory as reported with lint-vetting (#792)
Disable warnings related to the use of assert in the tests directory as reported with `lint-vetting` This adds a few additional files to the per-file-ignore list within the flake8 configuration with an exemption for S101 which is reported by flake8-bandit as part of the wemake style guide which is being vetted. The list was also alphabetized to ensure new entries were placed in a sane location. A note was added to the top of the flake8 per-file-ignores indicating that the glob for the tests folder ignoring s101 can be added later. Currently there is a conflict between globs and per-file entries. See PyCQA/flake8#670 This eliminates the S101 entry from the output of tox -e lint-vetting so users of it can see messages only related to the changes they are making and not for files that were previously added to the repository: 1 C812 missing trailing comma 1 RST304 Unknown interpreted text role "mod". - 13 S101 Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. 1 S404 Consider possible security implications associated with the subprocess module. 1 S603 subprocess call - check for execution of untrusted input. 2 S604 Function call with shell=True parameter identified, possible security issue. 2 WPS111 Found too short name: p < 2 2 WPS115 Found upper-case constant in a class: KEGEX 3 WPS201 Found module with too many imports: 13 > 12 6 WPS210 Found too many local variables: 6 > 5 3 WPS220 Found too deep nesting: 24 > 20 2 WPS221 Found line with high Jones Complexity: 16 > 14 3 WPS226 Found string literal over-use: test_option > 3 9 WPS305 Found `f` string 1 WPS316 Found context manager with too many assignments 6 WPS317 Found incorrect multi-line parameters 2 WPS323 Found `%` string formatting 4 WPS324 Found inconsistent `return` statement 2 WPS414 Found incorrect unpacking target 1 WPS430 Found nested function: getcwd 14 WPS436 Found protected module import: _curses 3 WPS450 Found protected object import: _CursesWindow 1 WPS602 Found using `@staticmethod` Related #713 Reviewed-by: Sviatoslav Sydorenko <webknjaz+github/[email protected]> Reviewed-by: Bradley A. Thornton <[email protected]> Reviewed-by: None <None>
1 parent 57f344e commit 4d97f97

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.flake8

+11-1
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,18 @@ inline-quotes = "
5959
max-line-length = 100
6060
6161
# Allow certain violations in certain files:
62-
# Please keep this list sorted, as it will be easier for others to find and add entries in the future
62+
# Please keep both sections of this list sorted, as it will be easier for others to find and add entries in the future
6363
per-file-ignores =
64+
# The following ignores have been researched and should be considered permanent
65+
# each should be preceeded with an explanation of each of the error codes
66+
# If other ignores are added for a specific file in the section following this,
67+
# these will need to be added to that line as well.
68+
69+
# S101: Allow the use of assert within the tests directory, since tests require it.
70+
tests/**.py: S101
71+
72+
# The following were present during the initial implementation.
73+
# They are expected to be fixed and unignored over time.
6474
docs/_ext/single_sourced_data.py: D400, D403, DAR101, DAR201, N817, P103, WPS110, WPS111, WPS201, WPS202, WPS210, WPS213, WPS221, WPS229, WPS231, WPS237, WPS305, WPS318, WPS323, WPS331, WPS336, WPS347, WPS407, WPS432, WPS440, WPS441, WPS453, WPS504
6575
docs/_ext/spelling_stub_ext.py: DAR101, DAR201
6676
docs/conf.py: WPS221, WPS226, WPS301, WPS305, WPS323, WPS420, WPS429, WPS433

0 commit comments

Comments
 (0)