-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement pylint E1519 singledispatch-method #970
- Loading branch information
Showing
7 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from functools import singledispatch | ||
|
||
|
||
class Board: | ||
@singledispatch # [singledispatch-method] | ||
@classmethod | ||
def convert_position(cls, position): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
crates/ruff_linter/src/rules/pylint/rules/single_dispatch_method.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use ruff_diagnostics::{Diagnostic, FixAvailability, Violation}; | ||
use ruff_macros::{derive_message_formats, violation}; | ||
use ruff_python_semantic::ScopeId; | ||
|
||
use ruff_source_file::SourceRow; | ||
|
||
use crate::checkers::ast::Checker; | ||
|
||
#[violation] | ||
pub struct SingleDispatchMethod {} | ||
|
||
impl Violation for SingleDispatchMethod { | ||
const FIX_AVAILABILITY: FixAvailability = FixAvailability::None; | ||
|
||
#[derive_message_formats] | ||
fn message(&self) -> String { | ||
format!("") | ||
} | ||
} | ||
|
||
/// E1519 | ||
pub(crate) fn single_dispatch_method(checker: &Checker, diagnostics: &mut Vec<Diagnostic>) {} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.