diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 55ed8a684b59..eed94c43a900 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -68,13 +68,6 @@ repos: ############################################################################## # Python/Cython formatting and linting ############################################################################## - - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 - hooks: - - id: pyupgrade - name: pyupgrade (ensure latest syntax) - args: ["--py39-plus"] - - repo: https://github.com/hadialqattan/pycln rev: v2.1.3 hooks: @@ -128,33 +121,7 @@ repos: hooks: - id: ruff - - repo: https://github.com/pycqa/pydocstyle - rev: 6.3.0 - hooks: - - id: pydocstyle - files: ^nautilus_trader/ - exclude: "nautilus_trader/test_kit" - args: - - "--ignore=D100,D102,D103,D104,D107,D105,D200,D203,D205,D212,D400,D413,D415,D416" - additional_dependencies: - - toml - - repo: https://github.com/kynan/nbstripout rev: 0.6.1 hooks: - id: nbstripout - -# pydocstyle ignore reasons -# ------------------------- -# D100: Missing docstring in public module **fix** -# D102: Missing docstring in public method **fix** -# D103: Missing docstring in public function **fix** -# D104: Missing docstring in public package **fix** -# D200: One-line docstring should fit on one line with quotes (optional style) -# D203: 1 blank line required before class docstring (optional style) -# D205: 1 blank line required between summary line and description (optional style) -# D212: Multi-line docstring summary should start at the first line (optional style) -# D400: First line should end with a period (not always a first line) -# D413: Missing blank line after last section ('Parameters') -# D415: First line should end with a period, question mark, or exclamation point (not always a first line) -# D416: Section name should end with a colon ('Warnings:', not 'Warnings') (incorrect?) diff --git a/pyproject.toml b/pyproject.toml index ad2946134fa6..ab8be78713f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -139,9 +139,69 @@ line_length = 100 # Linter configs # ########################################################## [tool.ruff] -# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default -select = ["E", "F"] -ignore = ["E741"] +select = [ + "E", + "F", + "W", + "C90", + "D", + "UP", + "S", + "T10", + "ICN", + "PYI", + "Q", + # "RSE", + "TID", + # "ARG", + # "ERA", + # "PD", + # "PGH", + # "PL", + # "PLE", + # "PLR", + # "PLW", + # "NPY", + # "RUF", +] + +ignore = [ + "E741", + "D100", + "D101", + "D102", + "D103", + "D104", + "D107", + "D105", + "D200", + "D203", + "D205", + "D212", + "D400", + "D413", + "D415", + "D416", + "S101", # Use of assert detected (OK in test suite) + "S105", # Use of hardcoded password (spurious) + "S106", # Use of hardcoded password (spurious) + "S113", # Probable use of requests call without timeout **fix** +] + +# pydocstyle ignore reasons +# ------------------------- +# D100: Missing docstring in public module **fix** +# D102: Missing docstring in public method **fix** +# D103: Missing docstring in public function **fix** +# D104: Missing docstring in public package **fix** +# D200: One-line docstring should fit on one line with quotes (optional style) +# D203: 1 blank line required before class docstring (optional style) +# D205: 1 blank line required between summary line and description (optional style) +# D212: Multi-line docstring summary should start at the first line (optional style) +# D400: First line should end with a period (not always a first line) +# D413: Missing blank line after last section ('Parameters') +# D415: First line should end with a period, question mark, or exclamation point (not always a first line) +# D416: Section name should end with a colon ('Warnings:', not 'Warnings') (incorrect?) # Allow autofix for all enabled rules (when `--fix`) is provided fixable = ["A", "B", "C", "D", "E", "F"] diff --git a/tests/integration_tests/adapters/betfair/test_kit.py b/tests/integration_tests/adapters/betfair/test_kit.py index 957402be5389..6aa78cf0ba42 100644 --- a/tests/integration_tests/adapters/betfair/test_kit.py +++ b/tests/integration_tests/adapters/betfair/test_kit.py @@ -635,7 +635,7 @@ def betting_instrument( @staticmethod def market_ids(): """ - A list of market_ids used by the tests. Used in `navigation_short` and `market_catalogue_short`. + Return a list of market_ids used by the tests. Used in `navigation_short` and `market_catalogue_short`. """ return ( "1.148894697", diff --git a/tests/unit_tests/serialization/conftest.py b/tests/unit_tests/serialization/conftest.py index 7118f2a56825..165c3624dde1 100644 --- a/tests/unit_tests/serialization/conftest.py +++ b/tests/unit_tests/serialization/conftest.py @@ -35,7 +35,7 @@ def _make_order_events(order, **kwargs): def nautilus_objects() -> list[Any]: - """A list of nautilus instances for testing serialization""" + """Return a list of nautilus instances for testing serialization""" instrument = TestInstrumentProvider.default_fx_ccy("AUD/USD") position_id = PositionId("P-001") buy = TestExecStubs.limit_order()