Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ pub(crate) fn boolean_default_value_positional_argument(
decorator_list: &[Decorator],
parameters: &Parameters,
) {
// https://github.com/astral-sh/ruff/issues/14535
if checker.source_type.is_stub() {
return;
}
// Allow Boolean defaults in explicitly-allowed functions.
if is_allowed_func_def(name) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ pub(crate) fn boolean_type_hint_positional_argument(
decorator_list: &[Decorator],
parameters: &Parameters,
) {
// https://github.com/astral-sh/ruff/issues/14535
if checker.source_type.is_stub() {
return;
}
// Allow Boolean type hints in explicitly-allowed functions.
if is_allowed_func_def(name) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ pub(crate) fn no_slots_in_namedtuple_subclass(
stmt: &Stmt,
class: &StmtClassDef,
) {
// https://github.com/astral-sh/ruff/issues/14535
if checker.source_type.is_stub() {
return;
}
let Some(Arguments { args: bases, .. }) = class.arguments.as_deref() else {
return;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ impl Violation for NoSlotsInStrSubclass {

/// SLOT000
pub(crate) fn no_slots_in_str_subclass(checker: &mut Checker, stmt: &Stmt, class: &StmtClassDef) {
// https://github.com/astral-sh/ruff/issues/14535
if checker.source_type.is_stub() {
return;
}
let Some(Arguments { args: bases, .. }) = class.arguments.as_deref() else {
return;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ impl Violation for NoSlotsInTupleSubclass {

/// SLOT001
pub(crate) fn no_slots_in_tuple_subclass(checker: &mut Checker, stmt: &Stmt, class: &StmtClassDef) {
// https://github.com/astral-sh/ruff/issues/14535
if checker.source_type.is_stub() {
return;
}
let Some(Arguments { args: bases, .. }) = class.arguments.as_deref() else {
return;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ impl Violation for BadDunderMethodName {

/// PLW3201
pub(crate) fn bad_dunder_method_name(checker: &mut Checker, method: &ast::StmtFunctionDef) {
// https://github.com/astral-sh/ruff/issues/14535
if checker.source_type.is_stub() {
return;
}
// If the name isn't a dunder, skip it.
if !method.name.starts_with('_') || !method.name.ends_with('_') {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ impl Violation for TooManyArguments {

/// PLR0913
pub(crate) fn too_many_arguments(checker: &mut Checker, function_def: &ast::StmtFunctionDef) {
// https://github.com/astral-sh/ruff/issues/14535
if checker.source_type.is_stub() {
return;
}
let semantic = checker.semantic();

let num_arguments = function_def
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ pub(crate) fn too_many_positional_arguments(
checker: &mut Checker,
function_def: &ast::StmtFunctionDef,
) {
// https://github.com/astral-sh/ruff/issues/14535
if checker.source_type.is_stub() {
return;
}
let semantic = checker.semantic();

// Count the number of positional arguments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ pub(crate) fn too_many_public_methods(
class_def: &ast::StmtClassDef,
max_methods: usize,
) {
// https://github.com/astral-sh/ruff/issues/14535
if checker.source_type.is_stub() {
return;
}
let methods = class_def
.body
.iter()
Expand Down