Skip to content

feat(ERA001): detect single-line code for try:, except:, etc. - #10057

Merged
MichaReiser merged 6 commits into
astral-sh:mainfrom
ottaviohartman:thartman/era-add-single-line
Feb 20, 2024
Merged

feat(ERA001): detect single-line code for try:, except:, etc.#10057
MichaReiser merged 6 commits into
astral-sh:mainfrom
ottaviohartman:thartman/era-add-single-line

Conversation

@ottaviohartman

Copy link
Copy Markdown
Contributor

Summary

Fixes #10056.

Adds more cases to the ERA001 eradicate rule:

  • add single-line detection for eradicate rule.
  • add bare except: handling.

Test Plan

  • Unit tested

@ottaviohartman ottaviohartman changed the title ERA001: detect single-line code for try:, except:, etc. feat(ERA001): detect single-line code for try:, except:, etc. Feb 20, 2024
@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Feb 20, 2024
@github-actions

Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@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.

Nice thank you

@MichaReiser
MichaReiser merged commit 0f70c99 into astral-sh:main Feb 20, 2024
nkxxll pushed a commit to nkxxll/ruff that referenced this pull request Mar 10, 2024
…-sh#10057)

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ERA001: detect single-line code for try:, except:, etc.

3 participants