Commit Graph

112 Commits

Author SHA1 Message Date
Jeroen Engels
ddaea22eab Move range manipulations fns out of Lint.Fix and into the rule that uses them 2019-08-22 19:48:46 +02:00
Jeroen Engels
5433526b2f Explain why we require providing the fix result in test error messages 2019-08-22 11:57:14 +02:00
Jeroen Engels
2c38878a6d Autofix all unused variables in NoUnusedVariables 2019-08-19 16:13:45 +02:00
Jeroen Engels
8fa510458e Fail applying a fix if ranges of the fixes overlap 2019-08-18 23:32:30 +02:00
Jeroen Engels
50f631c47c Add commented out tests for rangeUpUntil 2019-08-09 19:16:23 +02:00
Jeroen Engels
55fb6b71bb Improve NoUnusedVariables handles deleting the last declaration in a let in 2019-08-09 19:07:06 +02:00
Jeroen Engels
3b93133ada Fail applying a fix if the result becomes unparsable 2019-08-08 22:01:44 +02:00
Jeroen Engels
b7bbaff013 Fail the test with a helpful error message when fix does not change anything 2019-08-08 22:01:44 +02:00
Jeroen Engels
919467fee6 Add a way to check in tests that the fixed code is correct 2019-08-06 09:31:57 +02:00
Jeroen Engels
4eb024ef2e Make Lint.Fix.fix return a value that shows whether it was successful 2019-08-06 09:31:57 +02:00
Jeroen Engels
9e6160f8a6 Add ability to fix something on multiple lines 2019-08-06 09:31:57 +02:00
Jeroen Engels
76f0a8aaf2 Add tests for applying multiple fixes on a file 2019-08-06 09:31:57 +02:00
Jeroen Engels
330b1a1a7b Add tests for applying fixes on a single line 2019-08-06 09:31:57 +02:00
Jeroen Engels
d20396773e Move mergeRanges to Lint.Fix
Also add tests and documentation
2019-08-04 11:43:08 +02:00
Jeroen Engels
00215346ca Fix a bunch of typos about "it's" 2019-07-28 17:37:21 +02:00
Jeroen Engels
061fca8274 Check that the details are correct 2019-07-28 10:27:46 +02:00
Jeroen Engels
e27ea65b1a Add details in tests 2019-07-28 10:27:46 +02:00
Jeroen Engels
d593bae052 Add details to the message of every rule
This will make it easier to have helpful explanations and suggestions
like the Elm compiler does
2019-07-28 10:27:46 +02:00
Jeroen Engels
18a8514073 Show an example with Debug.todo rather than Debug.crash in NoDebug
Debug.crash has been removed in 0.19, and replaced by Debug.todo
2019-07-28 10:27:46 +02:00
Jeroen Engels
1cec4abc7f Rename module name in tests cases
Since the module name and the type were often the same, this should help 
remove some potential confusion
2019-07-25 11:16:54 +02:00
Jeroen Engels
45a10ebb3a Report unused import aliases that are named like a type 2019-07-25 10:40:23 +02:00
Jeroen Engels
527ee1c43a Report unused import aliases 2019-07-25 09:14:33 +02:00
Jeroen Engels
78562d1de5 Detect used types in pattern matching patterns 2019-07-25 00:19:43 +02:00
Jeroen Engels
2800e084e9 Organize the NoUnusedVariable rule tests 2019-07-24 18:58:56 +02:00
Jeroen Engels
7dc2094ff8 Reword the error message for the NoDebug rule 2019-07-23 00:16:02 +02:00
Jeroen Engels
6486148d25 Run missing locationIsAmbiguousInSourceCode test 2019-07-13 10:09:08 +02:00
Jeroen Engels
b829ab4f63 Lint.Test: Make error messgae formatting more consistent 2019-07-13 10:03:59 +02:00
Jeroen Engels
685e7dd6e1 Simplify the language used in Test error messages 2019-07-13 10:03:59 +02:00
Jeroen Engels
996c3039d6 Limit all Lint.Test error messages to 76 characters
This is so that they fit nicely in the terminal. The limit is usually 80
characters, but elm-test prepends every line by 4 spaces.
2019-07-13 10:03:58 +02:00
Jeroen Engels
905a74f901 Lint.Test: Add an identifiable name to errors to quickly be able to know what the problem is 2019-07-13 10:03:32 +02:00
Jeroen Engels
b6464dbff2 Move error messages out of Lint.Test and into Lint.Test.ErrorMessage 2019-07-11 08:47:33 +02:00
Jeroen Engels
1d3333f489 Add tests for the Test error messages 2019-07-11 08:47:33 +02:00
Jeroen Engels
6f26e13714 Remove rule DefaultPatternPosition
The compiler now forbids redundant patterns 👍
2019-07-08 22:23:27 +02:00
Jeroen Engels
2627b176df NoDebug: Forbid the import of the Debug module 2019-07-05 01:56:49 +02:00
Jeroen Engels
d576423905 NoDebug: Do not report when doing something like SomeModel.Debug.log 2019-07-05 01:56:49 +02:00
Jeroen Engels
3f6cc7c3e7 Add rule NoUnusedTypeConstructors 2019-07-05 01:21:30 +02:00
Jeroen Engels
fd6d142265 NoUnusedVariables: Do not report custom types for which a constructor was used 2019-07-05 00:33:51 +02:00
Jeroen Engels
396aa96c1f Remove comment about reporting unused pattern matching variables. This should be a new rule or option 2019-07-03 14:22:05 +02:00
Jeroen Engels
b236f10b5f Sort errors by position in the source code 2019-07-03 14:22:05 +02:00
Jeroen Engels
74c3c21bea NoUnusedVariables: Do not report types used in type signatures in a let in declaration 2019-07-02 11:55:49 +02:00
Jeroen Engels
c9a2a8e565 NoUnusedVariables: Do not report types used as arguments in custom types, or in type aliases 2019-07-02 11:42:07 +02:00
Jeroen Engels
b1b2a31e48 NoUnusedVariables: Do not report variables modified in a record update expression 2019-07-02 11:16:03 +02:00
Jeroen Engels
003336a735 Replace Lint.Test by the it's new version 2019-07-02 00:08:10 +02:00
Jeroen Engels
bf5a7dad8b Use new test module and improved the range for DefaultPatternPosition 2019-07-02 00:05:10 +02:00
Jeroen Engels
40cd398e35 Improve the range for NoExtraBooleanComparison 2019-07-02 00:05:10 +02:00
Jeroen Engels
e96b6610b2 Use new test module for NoExtraBooleanComparison 2019-07-02 00:05:10 +02:00
Jeroen Engels
75931b0f23 Use new test module for NoUnusedVariables 2019-07-02 00:05:10 +02:00
Jeroen Engels
8ffb30c450 Use new test module for NoDebug 2019-07-02 00:05:10 +02:00
Jeroen Engels
98d88e691e Use new test module for NoImportingEverything 2019-07-02 00:05:10 +02:00
Jeroen Engels
75e80d0926 Rewrite the Lint.Test module to have a nicer API and much better error messages 2019-07-02 00:05:10 +02:00