Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show errors for attempted fixes only when passed --verbose #15237

Merged
merged 5 commits into from
Jan 3, 2025

Conversation

dylwil3
Copy link
Collaborator

@dylwil3 dylwil3 commented Jan 3, 2025

The default logging level for diagnostics includes logs written using the log crate with level error, warn, and info. An unsuccessful fix attached to a diagnostic via try_set_fix or try_set_optional_fix was logged at level error. Note that the user would see these messages even without passing --fix, and possibly also on lines with noqa comments.

This PR changes the logging level here to a debug. We also found ad-hoc instances of error logging in the implementations of several rules, and have replaced those with either a debug or call to try_set{_optional}_fix.

Closes #15229

@dylwil3 dylwil3 added cli Related to the command-line interface diagnostics Related to reporting of diagnostics. labels Jan 3, 2025
Copy link
Contributor

github-actions bot commented Jan 3, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Thanks

@dylwil3 dylwil3 merged commit 706d87f into astral-sh:main Jan 3, 2025
21 checks passed
@dylwil3 dylwil3 deleted the error-visibility branch January 3, 2025 14:50
dcreager added a commit that referenced this pull request Jan 3, 2025
* main:
  [`ruff`] Avoid reporting when `ndigits` is possibly negative (`RUF057`) (#15234)
  Attribute panics to the mdtests that cause them (#15241)
  Show errors for attempted fixes only when passed `--verbose` (#15237)
  [`RUF`] Add rule to detect empty literal in deque call (`RUF025`) (#15104)
  TD003: remove issue code length restriction (#15175)
  Preserve multiline implicit concatenated strings in docstring positions (#15126)
  [`pyflakes`] Ignore errors in `@no_type_check` string annotations (`F722`, `F821`) (#15215)
  style(AIR302): rename removed_airflow_plugin_extension as check_airflow_plugin_extension (#15233)
  [`pylint`] Re-implement `unreachable` (`PLW0101`) (#10891)
  refactor(AIR303): move duplicate qualified_name.to_string() to Diagnostic argument (#15220)
  Misc. clean up to rounding rules (#15231)
  Avoid syntax error when removing int over multiple lines (#15230)
  Migrate renovate config (#15228)
  Remove `Type::tuple` in favor of `TupleType::from_elements` (#15218)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command-line interface diagnostics Related to reporting of diagnostics.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Errors for attempted autofixes visible to users even without passing --fix and for noqa lines
2 participants