diff --git a/action.yml b/action.yml index f3d3ced1..60fcf1b9 100644 --- a/action.yml +++ b/action.yml @@ -94,7 +94,10 @@ runs: shell: bash # Python formatting ------------------------------------------------------------------------------------------------ - # Note on sorting Python imports https://stackoverflow.com/questions/77876253/sort-imports-alphabetically-with-ruff + # Ignored rules explanation: + # D100: Missing docstring in public module + # D104: Missing docstring in public package + # D205: 1 blank line required between summary line and description - name: Run Python if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && inputs.python == 'true' && github.event.action != 'closed' run: | @@ -103,7 +106,8 @@ runs: . || true ruff check \ --fix \ - --extend-select I \ + --extend-select I,D \ + --ignore D100,D104,D205 \ . || true docformatter \ --wrap-summaries 120 \ diff --git a/utils/update_markdown_code_blocks.py b/utils/update_markdown_code_blocks.py index d0281dbb..96a09fb9 100644 --- a/utils/update_markdown_code_blocks.py +++ b/utils/update_markdown_code_blocks.py @@ -48,14 +48,19 @@ def format_code_with_ruff(temp_dir): print(f"ERROR running ruff format ❌ {e}") try: - # Run ruff check, ignore F821 Undefined name, F841 Local variable is assigned to but never used + # Run ruff check with ignored rules: + # D100: Missing docstring in public module + # D104: Missing docstring in public package + # D205: 1 blank line required between summary line and description + # F821: Undefined name + # F841: Local variable is assigned to but never used subprocess.run( [ "ruff", "check", "--fix", - "--extend-select=I", - "--ignore=F821,F841", + "--extend-select=I,D", + "--ignore=D100,D104,D205,F821,F841", str(temp_dir), ], check=True,