Skip to content

Commit

Permalink
Remove flake8 usage, use ruff in CI, fix ruff warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
insolor committed Jul 13, 2024
1 parent b3145cb commit a865fca
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 121 deletions.
5 changes: 0 additions & 5 deletions .flake8

This file was deleted.

1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ updates:
dev-dependencies:
patterns:
- "pytest*"
- "flake8*"
- "black"
- "isort"
- "coverage"
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@ jobs:
- name: Install library
run: poetry install --no-interaction

- name: Lint with flake8
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
poetry run ruff check . --statistics
- name: Test with pytest
run: |
poetry run pytest --cov=./
Expand Down
10 changes: 8 additions & 2 deletions df_translation_toolkit/convert/objects_po_to_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ def convert(po_file: TextIO, csv_file: TextIO, error_file: TextIO | None = None)


@app.command()
def main(po_file: Path, csv_file: Path, encoding: str, append: bool = False, errors_file: Path | None = None) -> None: # noqa: FBT001, FBT002
def main(
po_file: Path,
csv_file: Path,
encoding: str,
append: bool = False, # noqa: FBT001, FBT002
errors_file_path: Path | None = None,
) -> None:
"""
Convert a po file into a csv file in a specified encoding
"""
Expand All @@ -87,7 +93,7 @@ def main(po_file: Path, csv_file: Path, encoding: str, append: bool = False, err
mode = "a" if append else "w"
with (
open(csv_file, mode, newline="", encoding=encoding, errors="replace") as outfile,
maybe_open(errors_file, "w", encoding="utf-8") as errors_file,
maybe_open(errors_file_path, "w", encoding="utf-8") as errors_file,
):
convert(pofile, outfile, errors_file)

Expand Down
Loading

0 comments on commit a865fca

Please sign in to comment.