Skip to content

[flake8-pytest-style] Mark autofix for PT001 and PT023 as unsafe if there's comments in the decorator - #18792

Merged
MichaReiser merged 5 commits into
astral-sh:mainfrom
LaBatata101:fix-PT001
Jun 20, 2025
Merged

MichaReiser merged 5 commits into
astral-sh:mainfrom
LaBatata101:fix-PT001

Conversation

@LaBatata101

Copy link
Copy Markdown
Contributor

Summary

Fixes #18770

Test Plan

Add regression test

Comment thread crates/ruff_linter/src/rules/flake8_pytest_style/rules/fixture.rs Outdated
@github-actions

github-actions Bot commented Jun 19, 2025 •

Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@LaBatata101
LaBatata101 requested a review from MichaReiser June 19, 2025 14:50

@MichaReiser MichaReiser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@MichaReiser MichaReiser added bug An issue describing something that isn't working, or a PR that fixes a bug fixes Related to suggested fixes for violations labels Jun 20, 2025
@MichaReiser
MichaReiser merged commit 97819f8 into astral-sh:main Jun 20, 2025
@LaBatata101
LaBatata101 deleted the fix-PT001 branch June 20, 2025 13:50
dcreager added a commit that referenced this pull request Jun 20, 2025
* main: (21 commits)
  [`flake8-logging`] Avoid false positive for `exc_info=True` outside `logger.exception` (`LOG014`) (#18737)
  [`flake8-pie`] Small docs fix to `PIE794` (#18829)
  [`pylint`] Ignore __init__.py files in (PLC0414) (#18400)
  Avoid generating diagnostics with per-file ignores (#18801)
  [`flake8-simplify`] Fix false negatives for shadowed bindings  (`SIM910`, `SIM911`) (#18794)
  [ty] Fix panics when pulling types for `ClassVar` or `Final` parameterized with >1 argument (#18824)
  [`pylint`] add fix safety section (`PLR1714`) (#18415)
  [Perflint] Small docs improvement to `PERF401` (#18786)
  [`pylint`] Avoid flattening nested `min`/`max` when outer call has single argument (`PLW3301`) (#16885)
  [`ruff`] Added `cls.__dict__.get('__annotations__')` check (`RUF063`) (#18233)
  [ty] Use `HashTable` in `PlaceTable` (#18819)
  docs: Correct collections-named-tuple example to use PascalCase assignment (#16884)
  [ty] ecosystem-analyzer workflow (#18719)
  [ty] Add support for `@staticmethod`s (#18809)
  unnecessary_dict_kwargs doc - a note on type checking benefits (#18666)
  [`flake8-pytest-style`] Mark autofix for `PT001` and `PT023` as unsafe if there's comments in the decorator (#18792)
  [ty] Surface matched overload diagnostic directly (#18452)
  [ty] Report when a dataclass contains more than one `KW_ONLY` field (#18731)
  [`flake8-pie`] Add fix safety section to `PIE794` (#18802)
  [`pycodestyle`] Add fix safety section to `W291` and `W293`  (#18800)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An issue describing something that isn't working, or a PR that fixes a bug fixes Related to suggested fixes for violations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flake8-pytest-style] PT001/PT023 deletes comments inside the parenthesis

2 participants