From 769eed384da4796ffcb93a33b51fcc72c824fd2f Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Fri, 6 Sep 2024 13:25:41 +0300 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Christian Schou Oxvig <5367057+Chroxvi@users.noreply.github.com> --- .github/workflows/CI_pull_request.yml | 2 +- cotainr/cli.py | 3 ++- ruff.toml | 15 ++++++++------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CI_pull_request.yml b/.github/workflows/CI_pull_request.yml index 9219e4b..896e1cd 100644 --- a/.github/workflows/CI_pull_request.yml +++ b/.github/workflows/CI_pull_request.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.x" - uses: pre-commit/action@v3.0.1 run-full-test-suite: name: Run full test suite diff --git a/cotainr/cli.py b/cotainr/cli.py index 1d85608..51dcf46 100644 --- a/cotainr/cli.py +++ b/cotainr/cli.py @@ -51,7 +51,8 @@ class CotainrSubcommand(ABC): """Abstract base class for `CotainrCLI` subcommands.""" - @classmethod # noqa: B027 + @classmethod + @abstractmethod def add_arguments(cls, *, parser): """ Add command line arguments to arguments `parser`. diff --git a/ruff.toml b/ruff.toml index b478543..1468a37 100644 --- a/ruff.toml +++ b/ruff.toml @@ -2,11 +2,11 @@ target-version = "py38" line-length = 88 [lint] -extend-select = [ - "B", - "E", - "F", - "W", +select = [ + "B", # flake8-bugbear + "E", # pycodestyle errors + "F", # Pyflakes + "W", # pycodestyle warnings ] ignore = [ "E501", # ignore line length; auto-formatting will take care of what it can. @@ -20,8 +20,6 @@ exclude = [ # The non-standard way to import py.test fixtures in # tests means we will need to ignore "imported but not used" # as well as argument shadowing tests in test modules. - # It would be better to use standard `conftest` style fixture - # discovery. "F401", "F811", ] @@ -29,6 +27,9 @@ exclude = [ "S101", # assertions are OK in tests ] +[lint.pydocstyle] +convention = "numpy" + [format] exclude = [ "examples/**/*.ipynb",