-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[docs] Add docs for flake8-errmsg
#2888
[docs] Add docs for flake8-errmsg
#2888
Conversation
@@ -7,6 +7,51 @@ use crate::registry::{Diagnostic, Rule}; | |||
use crate::violation::Violation; | |||
|
|||
define_violation!( | |||
/// ## What it does | |||
/// Checks for raw usage of a string literal in Exception raising. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that the rule is currently named RawStringInException but I think it should be renamed from raw to direct since raw string usually refers to strings such as r"this"
.
So "raw usage" should be reworded here. Perhaps:
Checks for the direct supplying of a string literal to an exception constructor.
/// RuntimeError: 'Some value' is incorrect | ||
/// ``` | ||
/// | ||
/// Now there's a simpler traceback, less code, and no double message. If you have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
less code
is a bit ambiguous here ... your source code actually got more
This is again a case where I think it would make sense to merge all of these rules into one (see also #2714). They all check for the same problem ... I don't think there is any scenario where a user may want to enable one of these but not the others. |
cc43c54
to
393af04
Compare
393af04
to
bb334dd
Compare
Related: