Skip to content

Commit 4a07b84

Browse files
committed
Bump flake8 to 7.3.0 + fix linting issues
1 parent 7d1f654 commit 4a07b84

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ jobs:
4747
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
4848
- uses: actions/checkout@v2
4949

50-
- name: Install flake8
51-
run: pip install flake8
50+
- name: Install python packages
51+
run: pip install -r requirements.txt
5252

5353
- name: Run flake8
5454
run: flake8 .

pywikitools/correctbot/correctors/universal.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ def correct_wrong_capitalization(self, text: str) -> str:
6363
# TODO: Quotation marks are not yet covered - double check if necessary
6464
def is_exception(punctuation_pos: int):
6565
"""Is the punctuation found in text at position punctuation_pos part of an exception?"""
66-
nonlocal text
6766
for exception in self._capitalization_exceptions():
6867
# Example: text = "Use e.g. tests" and exception = "e.g."
6968
# Then is_exception(5) and is_exception(7) both return True as both dots are part of an exception
@@ -124,7 +123,7 @@ def correct_missing_spaces(self, text: str) -> str:
124123
last_start_pos = 0 # necessary to not run into endless loops
125124

126125
def does_match_exception(match: Match) -> bool:
127-
nonlocal check_missing_spaces, text, last_start_pos
126+
nonlocal last_start_pos
128127
for exception in self._missing_spaces_exceptions():
129128
exception_match = check_missing_spaces.search(exception)
130129
if not exception_match:

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
flake8>=6.1.0
1+
flake8>=7.3.0
22
coverage>=7.3.2
33
wikitextparser>=0.54.0
44
pywikibot>=8.4.0

0 commit comments

Comments
 (0)