no_magic_numbers
should not trigger in test code
#4896
Labels
enhancement
Ideas for improvements of existing features and rules.
good first issue
Issue to be taken up by new contributors yet unfamiliar with the project.
Description
In test code, it's reasonable to use raw numbers in assertions. The
no_magic_numbers
rule thus reports a lot of findings in tests.Defining another variable
let expected = 7
would not improve style, but would rather make the code more opaque and difficult to reason about.It's probably required to add a configuration option to specify which parent classes make a test class a test class. In the example, it's
XCTestCase
(the default of the option). This can be taken over from already existing rules specific for tests.Environment
The text was updated successfully, but these errors were encountered: