[STYLE]: Fixup Linting of Initial Files - #7
Conversation
c385737 to
800f62a
Compare
800f62a to
452bb2b
Compare
|
Note: Please scrutinize any changes made - some were by |
There was a problem hiding this comment.
I went through and spot checked for the changes you listed in the description and doesn't seem like any of them would break functionality to me. The only change block I didn't see changes for was:
SLF001 (8 fixes) - added public properties to OneDriveSurface (drive_id,
folder_path, indexing_delay), updated _OneDriveInjection to use them:
rampart/surfaces/onedrive.py:159,174,181-182,195,200
I also don't have context for all of the #noqa additions - were these added by linter? Approving to unblock since I'm out tomorrow but feel free to solicit a second pair of eyes if you'd like!
|
fix: resolve all 189 ruff lint violations Per-file-ignores for tests/ (pyproject.toml): S101, D100-D107, ANN001/ANN201/ANN202, PLR2004, ARG001/ARG002, PLC0415, SLF001, TRY003/EM101/EM102, BLE001, TRY301, S108, PT017/PT018, ASYNC240, PERF401, RUF015, PTH123 TC001/TC002/TC003 (45 fixes) - moved type-only imports into TYPE_CHECKING blocks: rampart/attacks/__init__.py, rampart/core/adapter.py, rampart/core/converter.py, rampart/core/execution.py, rampart/core/injection.py, rampart/core/prompt_driver.py, rampart/core/types.py, rampart/payloads/__init__.py, rampart/payloads/_generator.py, rampart/probes/__init__.py, rampart/probes/_single_turn.py, rampart/pytest_plugin/_collection.py, rampart/pytest_plugin/_session.py, rampart/pytest_plugin/plugin.py, rampart/reporting/json_file.py, rampart/surfaces/onedrive.py, rampart/_pyrit/llm_bridge.py, rampart/evaluators/response_contains.py, tests/fixtures.py TRY003/EM101/EM102 (50 fixes) - extracted exception messages to msg variable: rampart/_pyrit/llm_bridge.py:86-91, rampart/converters/docx.py:63-64, rampart/core/execution.py:146-148, rampart/core/types.py:119-131,217-218,300, rampart/drivers/__init__.py:37-39, rampart/payloads/__init__.py:144, rampart/payloads/_store.py:82,135-138,191-192,201-202,350, rampart/probes/__init__.py:87-88, rampart/pytest_plugin/_session.py:104-106, rampart/pytest_plugin/plugin.py:111-116,200-201, rampart/surfaces/onedrive.py:95-97,104-107,119-121,180-182 PYI034 (9 fixes) - changed __aenter__ return type to Self: rampart/core/adapter.py:42, rampart/core/injection.py:41, rampart/surfaces/onedrive.py:171, tests/fixtures.py:43, tests/unit/core/test_execution.py:25, tests/unit/core/test_protocols.py:23,43,89,118 PYI036/ANN401 (9 fixes) - changed exc_tb: Any to types.TracebackType | None: rampart/core/adapter.py:51, rampart/core/injection.py:50, rampart/surfaces/onedrive.py:203, tests/fixtures.py:53, tests/unit/core/test_execution.py:33, tests/unit/core/test_protocols.py:30,50,96,125 D107 (8 fixes) - added __init__ docstrings: rampart/converters/docx.py:34, rampart/core/execution.py:182, rampart/drivers/static.py:25, rampart/evaluators/response_contains.py:23, rampart/evaluators/side_effect.py:19, rampart/evaluators/tool_called.py:26, rampart/reporting/json_file.py:39, rampart/surfaces/onedrive.py:51 D205 (3 fixes) - inserted blank line after docstring summary: rampart/core/execution.py:201, rampart/pytest_plugin/plugin.py:122, tests/fixtures.py:57 E501 (10 fixes) - shortened lines exceeding 88 chars: rampart/core/execution.py:78, rampart/core/manifest.py:88,97, rampart/core/result.py:137, rampart/evaluators/response_contains.py:19, rampart/probes/_single_turn.py:104, rampart/pytest_plugin/_session.py:106, tests/fixtures.py:86, tests/unit/attacks/test_xpia.py:72, tests/unit/core/test_result.py:1 SLF001 (8 fixes) - added public properties to OneDriveSurface (drive_id, folder_path, indexing_delay), updated _OneDriveInjection to use them: rampart/surfaces/onedrive.py:159,174,181-182,195,200 PLW2901 (2 fixes) - renamed loop variables to avoid reassignment: rampart/payloads/_store.py:143-144 (line -> raw_line) rampart/pytest_plugin/_session.py:146 (result -> original_result) PLR2004 (1 fix) - extracted magic value to _PREVIEW_MAX_LENGTH constant: rampart/core/types.py:136-137 RUF006 (1 fix) - stored create_task return value: rampart/pytest_plugin/plugin.py:523 noqa suppressions introduced (29 total): rampart/_pyrit/llm_bridge.py:128,130 PLC0415 deferred pyrit imports rampart/converters/docx.py:41 PLC0415 lazy pyrit converter import rampart/core/execution.py:314 BLE001 handler safety catch rampart/evaluators/side_effect.py:19 ANN401 **kwargs API design rampart/evaluators/tool_called.py:26 ANN401 **kwargs API design rampart/payloads/__init__.py:92 PLR0913 factory method rampart/probes/__init__.py:56 PLR0913 factory method rampart/probes/__init__.py:98 S101 type narrowing assert rampart/pytest_plugin/plugin.py:223-224 SLF001 pytest item private attrs rampart/pytest_plugin/plugin.py:240 ARG001 pytest hook signature rampart/pytest_plugin/plugin.py:297 BLE001 plugin safety catch rampart/pytest_plugin/plugin.py:458 ARG001 pytest hook signature rampart/pytest_plugin/plugin.py:496 BLE001 sink teardown safety rampart/pytest_plugin/plugin.py:523 RUF006 fire-and-forget task rampart/pytest_plugin/plugin.py:528,559,580 ANN401 no public type for terminalreporter rampart/pytest_plugin/plugin.py:581 ARG001 pytest hook signature rampart/surfaces/onedrive.py:202 SLF001 inner class -> parent._upload_async rampart/surfaces/onedrive.py:226 SLF001 inner class -> parent._delete_async rampart/surfaces/onedrive.py:227 BLE001 cleanup must not raise tests/unit/pytest_plugin/test_plugin.py:35-51 ANN401 x6 _StashStub dict mock tests/unit/surfaces/test_onedrive.py:25 ANN401 sentinel default tests/unit/surfaces/test_onedrive.py:63 ANN401 mock dispatch return
54318b0 to
cd3cace
Compare
cd3cace to
d8dcd68
Compare
Description
Sets up ruff config and fixes existing project files
See fixes
Breaking changes
None
Checklist
pre-commit run --all-filespasses (see [MAINT]: Add project metadata, pyright, coverage config, and editorconfig #9 forpytest testswarnings to disappear)