ruff/crates/ruff_linter/resources/test/fixtures/pylint
Auguste Lalande 8fba97f72f
`PLR2004`: Accept 0.0 and 1.0 as common magic values (#9964)
## Summary

Accept 0.0 and 1.0 as common magic values. This is in line with the
pylint behaviour, and I think makes sense conceptually.


## Test Plan

Test cases were added to
`crates/ruff_linter/resources/test/fixtures/pylint/magic_value_comparison.py`
2024-02-13 01:21:06 +00:00
..
import_private_name [`pylint`] (Re-)Implement `import-private-name` (`C2701`) (#9553) 2024-01-16 14:03:11 -05:00
import_self Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
assert_on_string_literal.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
await_outside_async.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
bad_dunder_method_name.py [`pylint`] Add `__mro_entries__` to known dunder methods (`PLW3201`) (#9706) 2024-01-30 11:41:19 -05:00
bad_open_mode.py [pylint] Implement bad-open-mode (W1501) (#8294) 2023-10-28 22:30:31 +00:00
bad_str_strip_call.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
bad_string_format_character.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
bad_string_format_type.py Fix bug where `PLE1307` was raised when formatting `%c` with characters (#8407) 2023-11-02 04:36:52 +00:00
bidirectional_unicode.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
binary_op_exception.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
collapsible_else_if.py [`pylint`] Add fix for `collapsible-else-if` (`PLR5501`) (#9594) 2024-01-21 19:53:15 -05:00
compare_to_empty_string.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
comparison_of_constant.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
comparison_with_itself.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
continue_in_finally.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
duplicate_bases.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
empty_comment.py Avoid panic when comment is preceded by Unicode (#9331) 2023-12-31 12:54:31 +00:00
eq_without_hash.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
global_at_module_level.py [pylint] - implement `global-at-module-level` (`W0604`) (#8058) 2023-10-19 04:48:27 +00:00
global_statement.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
global_variable_not_assigned.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
import_aliasing.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
import_outside_top_level.py Implement pylint import-outside-toplevel rule (C0415) (#5180) 2023-10-29 16:40:26 +00:00
invalid_all_format.py Allow named expressions in `__all__` assignments (#7673) 2023-09-27 00:36:55 -04:00
invalid_all_object.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
invalid_characters.py Fix PLE251 rules with f-string escaping (#7741) 2023-10-02 08:43:39 +00:00
invalid_envvar_default.py Support `IfExp` with dual string arms in `invalid-envvar-default` (#9734) 2024-01-31 10:41:24 -05:00
invalid_envvar_value.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
invalid_return_type_str.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
iteration_over_set.py Use set bracket replacement for `iteration-over-set` (#8001) 2023-10-17 04:12:05 +00:00
literal_membership.py [`pylint`] Avoid suggesting set rewrites for non-hashable types (#9956) 2024-02-12 13:05:54 -05:00
load_before_global_declaration.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
logging_too_few_args.py Add `Expr::Name` checks to rules which use `is_logger_candidate` (#7521) 2023-09-27 00:21:22 +00:00
logging_too_many_args.py Add `Expr::Name` checks to rules which use `is_logger_candidate` (#7521) 2023-09-27 00:21:22 +00:00
magic_value_comparison.py `PLR2004`: Accept 0.0 and 1.0 as common magic values (#9964) 2024-02-13 01:21:06 +00:00
misplaced_bare_raise.py [pylint] Implement misplaced-bare-raise (E0704) (#7961) 2023-10-17 03:07:46 +00:00
misplaced_comparison_constant.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
named_expr_without_context.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
nested_min_max.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
no_method_decorator.py [pylint] - implement R0202 and R0203 with autofixes (#8335) 2023-11-30 16:18:09 -06:00
no_self_use.py Fix false positive in `PLR6301` (#7933) 2023-10-14 14:55:38 -04:00
non_ascii_module_import.py [pylint] - Implement `non-ascii-module-import` (`C2403`) (#8056) 2023-10-20 18:06:22 +00:00
non_ascii_name.py [pylint] - implement `non-ascii-name` (`C2401`) (#8038) 2023-10-20 18:53:51 +00:00
non_slot_assignment.py [`pylint`] Implement `assigning-non-slot` (`E0237`) (#9623) 2024-01-24 02:50:22 +00:00
nonlocal_without_binding.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
potential_index_error.py [`pylint`] Implement `potential-index-error` (`PLE0643`) (#9545) 2024-01-21 03:59:48 +00:00
property_with_parameters.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
redefined_argument_from_local.py [pylint] Implement redefined-argument-from-local (R1704) (#8159) 2023-11-10 14:13:07 -05:00
redefined_loop_name.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
repeated_equality_comparison.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
repeated_isinstance_calls.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
repeated_keyword_argument.py Add Implementation for Pylint E1132: Repeated Keyword (#8706) 2023-11-19 00:26:24 +00:00
return_in_init.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
self_assigning_variable.py [`pylint`] Extend `self-assigning-variable` to multi-target assignments (#8839) 2023-11-25 18:42:19 +00:00
single_string_slots.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
subprocess_popen_preexec_fn.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
subprocess_run_without_check.py [`pylint`] Add fix for `subprocess-run-without-check` (`PLW1510`) (#6708) 2023-12-12 05:08:17 +00:00
super_without_brackets.py [pylint] - implement `super-without-brackets`/`W0245` (#9257) 2024-01-02 21:57:53 +00:00
sys_exit_alias_0.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
sys_exit_alias_1.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
sys_exit_alias_2.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
sys_exit_alias_3.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
sys_exit_alias_4.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
sys_exit_alias_5.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
sys_exit_alias_6.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
sys_exit_alias_7.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
sys_exit_alias_8.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
sys_exit_alias_9.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
sys_exit_alias_10.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
sys_exit_alias_11.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
sys_exit_alias_12.py Avoid inserting imports directly after continuation (#7553) 2023-09-20 21:26:48 +00:00
too_many_arguments.py Ignore `@overload` and `@override` methods for too-many-arguments checks (#8954) 2023-12-01 18:22:53 +00:00
too_many_arguments_params.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
too_many_boolean_expressions.py [pylint] Implement PLR0916 (`too-many-boolean-expressions`) (#7975) 2023-10-17 04:44:25 +00:00
too_many_branches.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
too_many_branches_params.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
too_many_locals.py [`pylint`] Implement `too-many-locals` (`PLR0914`) (#9163) 2023-12-18 20:00:04 +00:00
too_many_nested_blocks.py [`pylint`] Implement `too-many-nested-blocks` (`PLR1702`) (#9172) 2024-01-24 19:30:01 +00:00
too_many_positional.py [`pylint`] Exclude `self` and `cls` when counting method arguments (#9563) 2024-01-18 03:17:45 +00:00
too_many_positional_params.py [`pylint`] Implement `too-many-positional` (`PLR0917`) (#8995) 2023-12-04 18:03:09 +00:00
too_many_public_methods.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
too_many_return_statements.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
too_many_return_statements_params.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
too_many_statements.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
too_many_statements_params.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
type_bivariance.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
type_name_incorrect_variance.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
type_param_name_mismatch.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
unexpected_special_method_signature.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
unnecessary_dict_index_lookup.py Avoid unnecessary index diagnostics when value is modified (#8970) 2023-12-02 18:17:17 +00:00
unnecessary_direct_lambda_call.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
unnecessary_dunder_call.py Drop `__get__` and `__set__` from `unnecessary-dunder-call` (#9791) 2024-02-05 10:54:29 -05:00
unnecessary_lambda.py [pylint] Implement unnecessary-lambda (W0108) (#7953) 2023-10-20 17:25:24 +00:00
unnecessary_list_index_lookup.py Avoid unnecessary index diagnostics when value is modified (#8970) 2023-12-02 18:17:17 +00:00
unspecified_encoding.py [`pylint`] Add `add_argument` utility and autofix for `PLW1514` (#8928) 2023-12-01 18:23:56 +00:00
useless_else_on_loop.py [`pylint`] Add fix for `useless-else-on-loop` (`PLW0120`) (#9590) 2024-01-21 11:17:58 -05:00
useless_return.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
useless_with_lock.py [pylint] Implement `useless-with-lock` (#8321) 2023-10-29 16:24:52 +00:00
yield_from_in_async_function.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
yield_in_init.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00