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

[docs] Add docs for flake8-errmsg #2888

Merged
merged 4 commits into from
Feb 14, 2023

Conversation

edgarrmondragon
Copy link
Contributor

@@ -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.
Copy link
Contributor

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
Copy link
Contributor

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

@not-my-profile
Copy link
Contributor

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.

@charliermarsh charliermarsh force-pushed the docs/flake8-errmsg branch 2 times, most recently from cc43c54 to 393af04 Compare February 14, 2023 22:52
@charliermarsh charliermarsh enabled auto-merge (squash) February 14, 2023 22:52
@charliermarsh charliermarsh merged commit c0eb5c2 into astral-sh:main Feb 14, 2023
@edgarrmondragon edgarrmondragon deleted the docs/flake8-errmsg branch February 15, 2023 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants