Skip to content

Commit

Permalink
Fix fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Feb 20, 2023
1 parent 53589f2 commit 26e2119
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 8 deletions.
8 changes: 2 additions & 6 deletions crates/ruff/resources/test/fixtures/tryceratops/TRY401.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# These SHOULD change


# Errors
def main_function():
try:
process()
Expand Down Expand Up @@ -52,9 +50,7 @@ def func_comma():
logger.exception("log message", ex)


# These should NOT change


# OK
def main_function():
try:
process()
Expand Down
2 changes: 1 addition & 1 deletion crates/ruff/src/checkers/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@ where
if self.settings.rules.enabled(&Rule::VerboseRaise) {
tryceratops::rules::verbose_raise(self, handlers);
}
if self.settings.rules.enabled(&Rule::VerboseRaise) {
if self.settings.rules.enabled(&Rule::VerboseLogMessage) {
tryceratops::rules::verbose_log_message(self, handlers);
}
if self.settings.rules.enabled(&Rule::RaiseWithinTry) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use ruff_macros::{define_violation, derive_message_formats};
use rustpython_parser::ast::{Excepthandler, ExcepthandlerKind, Expr, ExprKind};

use ruff_macros::{define_violation, derive_message_formats};

use crate::ast::types::Range;
use crate::ast::visitor;
use crate::ast::visitor::Visitor;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
source: crates/ruff/src/rules/tryceratops/mod.rs
expression: diagnostics
---
- kind:
VerboseLogMessage: ~
location:
row: 8
column: 44
end_location:
row: 8
column: 46
fix: ~
parent: ~
- kind:
VerboseLogMessage: ~
location:
row: 19
column: 52
end_location:
row: 19
column: 55
fix: ~
parent: ~
- kind:
VerboseLogMessage: ~
location:
row: 21
column: 43
end_location:
row: 21
column: 46
fix: ~
parent: ~
- kind:
VerboseLogMessage: ~
location:
row: 21
column: 49
end_location:
row: 21
column: 52
fix: ~
parent: ~
- kind:
VerboseLogMessage: ~
location:
row: 23
column: 43
end_location:
row: 23
column: 46
fix: ~
parent: ~
- kind:
VerboseLogMessage: ~
location:
row: 24
column: 43
end_location:
row: 24
column: 46
fix: ~
parent: ~
- kind:
VerboseLogMessage: ~
location:
row: 36
column: 40
end_location:
row: 36
column: 42
fix: ~
parent: ~
- kind:
VerboseLogMessage: ~
location:
row: 43
column: 47
end_location:
row: 43
column: 49
fix: ~
parent: ~
- kind:
VerboseLogMessage: ~
location:
row: 50
column: 40
end_location:
row: 50
column: 42
fix: ~
parent: ~

0 comments on commit 26e2119

Please sign in to comment.