Skip to content

Commit 93cb808

Browse files
committed
fix(style): flake8 ignore rules & improve style
Updated flake8 ignore rules to include W293 and W503. Improved comments for clarity on linting behavior. See [Action Run #17 (17516215023) > build > Lint with flake8](https://github.com/SyntaxAerror/stat-log-db/actions/runs/17516215023)
1 parent 817f5dd commit 93cb808

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.github/workflows/python-package.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ jobs:
3131
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
3232
- name: Lint with flake8
3333
run: |
34-
# stop the build if there are Python syntax errors or undefined names
35-
flake8 . --count --select=E9,F63,F7,F82 --ignore=E261 --show-source --statistics
34+
# stop the build if th1ere are Python syntax errors or undefined names
35+
# Notes:
36+
# W503: https://peps.python.org/pep-0008/#should-a-line-break-before-or-after-a-binary-operator
37+
flake8 . --count --select=E9,F63,F7,F82 --ignore=E261,W293,W503 --show-source --statistics
3638
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3739
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3840
- name: Install stat-log-db package (dev)

stat_log_db/src/stat_log_db/db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def drop_table(self, table_name: str, raise_if_not_exists: bool = False):
451451
if not isinstance(table_name, str):
452452
raise_auto_arg_type_error("table_name")
453453
if len(table_name) == 0:
454-
raise ValueError(f"'table_name' argument of drop_table cannot be an empty string!")
454+
raise ValueError("'table_name' argument of drop_table cannot be an empty string!")
455455

456456
# Validate and sanitize table name
457457
validated_table_name = self._validate_sql_identifier(table_name, "table name")

tests/test_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _find_bash_executable(): # TODO: Improve this
5151
# Common Git Bash locations on Windows
5252
common_paths = [
5353
r"C:\Program Files\Git\bin\bash.exe",
54-
r"C:\Program Files (x86)\Git\bin\bash.exe",
54+
r"C:\Program Files (x86)\Git\bin\bash.exe",
5555
r"C:\Users\{}\AppData\Local\Programs\Git\bin\bash.exe".format(os.getenv("USERNAME", "")),
5656
r"C:\Git\bin\bash.exe",
5757
]

0 commit comments

Comments
 (0)