Commit Graph

619 Commits

Author SHA1 Message Date
Jeroen Engels
207ffe1cab Report the line for Unreleased 2024-04-10 20:13:03 +02:00
Jeroen Engels
50877660e9 Add findUnreleasedRange 2024-04-10 20:13:03 +02:00
Jeroen Engels
f34f59054d Extract to function 2024-04-10 20:13:03 +02:00
Jeroen Engels
24b4782400 Expect to be under Unreleased 2024-04-10 20:13:02 +02:00
Jeroen Engels
e4a6ff3bae Add [Unreleased] to tests 2024-04-10 20:13:02 +02:00
Jeroen Engels
e15e7a8818 Update range 2024-04-10 20:13:02 +02:00
Jeroen Engels
dcdfec8d54 Target changelog in tests 2024-04-10 20:13:02 +02:00
Jeroen Engels
40d88b9f54 Report an error for the changelog file 2024-04-10 20:13:02 +02:00
Jeroen Engels
349d69727d fixup! Add visitor for the changelog 2024-04-10 20:13:02 +02:00
Jeroen Engels
aa7d289e99 Don't report errors if the version is 1.0.0 2024-04-10 20:13:02 +02:00
Jeroen Engels
20a42e35f8 Pass a version when creating a package in tests 2024-04-10 20:13:02 +02:00
Jeroen Engels
a2bd65eeb6 Report an error if the project is an application 2024-04-10 20:13:02 +02:00
Jeroen Engels
04fdc1fba1 Report a global error when the path was custom but could not be found 2024-04-10 20:13:02 +02:00
Jeroen Engels
8b7704baf9 Report a global error if the changelog could not be found 2024-04-10 20:13:02 +02:00
Jeroen Engels
8e8a2c03d9 Add the ability to configure the path 2024-04-10 20:13:02 +02:00
Jeroen Engels
f59a396548 Report an error when the version could not be found 2024-04-10 20:13:02 +02:00
Jeroen Engels
5bdbed5b28 Add visitor for the changelog 2024-04-10 20:13:02 +02:00
Jeroen Engels
af23bbaf73 Add elm.json visitor to get the version 2024-04-10 20:13:02 +02:00
Jeroen Engels
51579cf373 Add tests 2024-04-10 20:13:02 +02:00
Jeroen Engels
5ba34073f1 Add new rule Docs.NoMissingChangelogEntry 2024-04-10 20:13:02 +02:00
Jeroen Engels
9ebf3bc409 Add test for the visiting order of extra files 2024-04-10 20:12:59 +02:00
Jeroen Engels
ea44cf22bb Name things extra files instead of arbitrary files 2024-04-10 20:12:59 +02:00
Jeroen Engels
e739f882e4 Add test to make sure files only have access to the files they requested 2024-04-10 20:12:59 +02:00
Jeroen Engels
9b96c975eb Add the visitor in each test 2024-04-10 20:12:59 +02:00
Jeroen Engels
a22fc9132e Add helper function for creating project in tests 2024-04-10 20:12:59 +02:00
Jeroen Engels
3816ab1074 Filter out files that were not requested 2024-04-10 20:12:59 +02:00
Jeroen Engels
08647ec79d Remove unused import 2024-04-10 20:12:59 +02:00
Jeroen Engels
318c6107e6 Use exact matches for now in tests 2024-04-10 20:12:59 +02:00
Jeroen Engels
50f869a431 Add a requested files field 2024-04-10 20:12:59 +02:00
Jeroen Engels
1850b55de8 Add test for arbitrary files visitor 2024-04-10 20:12:59 +02:00
Jeroen Engels
b125d5049c Fix module name lookup table giving a wrong result
Let destructuring variables that shadowed imports were not correctly
registered, and looking them up could lead to incorrectly point to
the imported module that was shadowed.

Thanks @matzko for discovering this.
2024-04-09 20:17:02 +02:00
Jeroen Engels
de511c2f6f Fix test around JSON decoding error message
Between Node.js v18 and v20, the error message when failing to decode JSON has been changed to be more helpful. This failed the test suite because the error message was still made for v18 environments.

Henceforth tests for this project should be run on v20+ versions of
Node.js.
2024-04-09 20:15:25 +02:00
Jeroen Engels
60a15216a9 Backport rules from cognitive-complexity 2023-09-03 11:45:53 +02:00
Jeroen Engels
f01508a61c Backport rules from unused 2023-09-03 11:31:00 +02:00
Jeroen Engels
b7842e704b Backport rules from simplify 2023-09-03 11:30:45 +02:00
Jeroen Engels
1db1a05c69 Apply simplifications 2023-06-26 22:06:21 +02:00
Jeroen Engels
efd3fc151a Backport rules from packages 2023-06-25 22:44:48 +02:00
Jeroen Engels
929d8508fd Fix let function arguments not registering with the correct module name 2023-06-17 19:49:41 +02:00
Jeroen Engels
84aae3b64b Make test setup failure more helpful 2023-06-17 19:49:41 +02:00
Jeroen Engels
f5cf817169 Remove outdated TODOs 2023-04-15 20:32:55 +02:00
Jeroen Engels
ed59b64dae Turn fixes into ErrorFixes 2023-04-11 00:13:48 +02:00
Jeroen Engels
c32689a730 Add test for checking that README fixed are applied 2023-04-10 11:49:41 +02:00
Jeroen Engels
b3bb662b36 Add test package elm.json 2023-04-10 11:40:14 +02:00
Jeroen Engels
084b8d3860 Add helper to parse elm.json files 2023-04-10 11:39:07 +02:00
Jeroen Engels
34aa2835a1 Add new test 2023-04-10 08:53:25 +02:00
Jeroen Engels
8c0c8cbe52 Check the fixed errors 2023-04-10 08:53:25 +02:00
Jeroen Engels
1fe9f61518 Decode the elm.json to avoid inconsistencies 2023-04-10 08:53:25 +02:00
Jeroen Engels
1ad68a693e Add alias to Json.Encode 2023-04-10 08:53:25 +02:00
Jeroen Engels
3e96146587 Add test to check that fixes work on elm.json 2023-04-10 08:53:25 +02:00
Jeroen Engels
1b4608a680 Add a helper to create a version 2023-04-10 08:53:25 +02:00
Jeroen Engels
abf205c24f Pass the rule explicitly 2023-04-10 08:53:25 +02:00
Jeroen Engels
7f60cb7327 Add utilities to create elm.json files 2023-04-10 08:53:25 +02:00
Jeroen Engels
eb25c6dff6 Add a test for fixes with limits 2023-04-10 08:53:25 +02:00
Jeroen Engels
2391a52cef Change test titles 2023-04-10 08:53:25 +02:00
Jeroen Engels
9f07a21a34 Add an expectation on the fixed errors 2023-04-10 08:53:25 +02:00
Jeroen Engels
c7a39beccb Extract variable 2023-04-10 08:53:25 +02:00
Jeroen Engels
dc8077ebda Use less pipes 2023-04-10 08:53:25 +02:00
Jeroen Engels
f16dfc3ce6 USe Expect.all 2023-04-10 08:53:25 +02:00
Jeroen Engels
187dcd78e1 Extract variable 2023-04-10 08:53:25 +02:00
Jeroen Engels
3649eaec15 Fix another problem 2023-04-10 08:53:25 +02:00
Jeroen Engels
3c3380f5cf Add helper 2023-04-10 08:53:25 +02:00
Jeroen Engels
24ea436bd1 Improve order test to check that imports are visited one in the right order 2023-03-30 10:30:59 +02:00
Jeroen Engels
484442ce3c Add test for the order of case branches 2023-03-18 10:04:16 +01:00
Jeroen Engels
fbc86c0adf Add test for the order of let declarations 2023-03-18 10:04:16 +01:00
Jeroen Engels
704537ffa2 Rename ignoredFilesImpactsResults to ignoredFilesImpactResults 2023-01-22 09:24:43 +01:00
Jeroen Engels
9decbec8df Make a nice error message 2023-01-22 09:11:26 +01:00
Jeroen Engels
c5d1bd74b0 Add a test case 2023-01-22 09:11:26 +01:00
Jeroen Engels
365e838bac Test empty details for configuration errors 2022-12-28 16:45:25 +01:00
Jeroen Engels
227db6df30 Test empty details for global errors 2022-12-28 16:45:25 +01:00
Jeroen Engels
988c9364aa Add test for checking an empty details 2022-12-28 16:45:25 +01:00
Jeroen Engels
66dc42725d Add helper to easily create custom message/details in tests 2022-12-28 16:45:25 +01:00
Jeroen Engels
07999d3d3f Make error message more consistent 2022-12-28 16:45:25 +01:00
Jeroen Engels
3504cac433 Add test for checking an unexpected configuration error 2022-12-28 16:45:25 +01:00
Jeroen Engels
087fb63d4c Add test for checking the configuration error message 2022-12-28 16:45:25 +01:00
Jeroen Engels
02302ef0e0 Use expectations of failure to test unexpected configuration error details 2022-12-28 16:45:25 +01:00
Jeroen Engels
d4e54f2691 Use expectations of failure to test unexpected global error details 2022-12-28 16:45:25 +01:00
Jeroen Engels
aee3c0f8a4 Use expectations of failure to test unexpected details 2022-12-28 16:45:25 +01:00
Jeroen Engels
a084a208db Also check for the length of the error messaage 2022-12-28 16:45:25 +01:00
Jeroen Engels
338b47735e Use expectations of failure to test incorrect under position 2022-12-28 16:45:25 +01:00
Jeroen Engels
8f0afe515b Use expectations of failure to test unexpected global error message 2022-12-28 16:45:25 +01:00
Jeroen Engels
c2f95dec1f Use expectations of failure to test unexpected error message 2022-12-28 16:45:25 +01:00
Jeroen Engels
f88e0fbda2 Use expectations of failure to test unexpected global errors 2022-12-28 16:45:25 +01:00
Jeroen Engels
6f417c8431 Rename test rule 2022-12-28 16:45:25 +01:00
Jeroen Engels
84a861f4b7 Use expectations of failure to test unexpected errors 2022-12-28 16:45:21 +01:00
Jeroen Engels
aa9f1384f5 Use expectations of failure to test parsing errors 2022-12-28 16:45:21 +01:00
Jeroen Engels
66ee143b08 Fix withIsFileIgnored returning the wrong value 2022-12-20 21:53:04 +01:00
Jeroen Engels
6bdb985f8f Backport rules from elm-review-cognitive-complexity 2022-12-16 16:54:04 +01:00
Jeroen Engels
73262f6f47 Backport rules from packages 2022-12-08 16:27:43 +01:00
Jeroen Engels
0d55d0b858 Backport rules from elm-review-cognitive-complexity 2022-12-02 00:05:33 +01:00
Jeroen Engels
e1766bad01 Make failure message on unexpected extract helpful 2022-12-01 22:24:34 +01:00
Jeroen Engels
2950e5d250 Backport rules from elm-review-simplify 2022-11-09 15:58:49 +01:00
Jeroen Engels
06580612f2 Backport rules from elm-review-unused 2022-11-09 15:58:49 +01:00
Jeroen Engels
aa4589a36e Change the API again 2022-11-01 17:54:44 +01:00
Jeroen Engels
c8453f401e Replace withFixAll and withFixLimit by withFixes 2022-10-30 23:29:57 +01:00
Jeroen Engels
0f786d7514 Remove unnecessary visitor 2022-10-29 21:27:30 +02:00
Jeroen Engels
155b6c6f23 Add provides information to rules in tests 2022-10-29 17:58:25 +02:00
Jeroen Engels
59d7ef4b1a Revert back to using core List functions
Since the next version of elm-review will now use the versions from
elm-optimize-level-2
2022-10-29 17:58:25 +02:00
Jeroen Engels
858ae494f5 Backport rules from elm-review-unused 2022-10-29 17:58:25 +02:00
Jeroen Engels
a198634521 Annotate rules as providing fixes 2022-10-29 17:58:25 +02:00
Jeroen Engels
985d4c46c2 Add test for fix all 2022-10-29 17:58:24 +02:00
Jeroen Engels
f27b42d4f3 Remove unnecessary operations on errors 2022-10-29 17:58:24 +02:00
Jeroen Engels
4d3f2bc078 Backport elm-review-debug 2022-10-15 11:52:21 +02:00
Jeroen Engels
65c023481a Add test rule for extracting data 2022-10-12 16:39:00 +02:00
Jeroen Engels
363b48c7e8 Add expectations for the data extract in the test module 2022-10-12 16:39:00 +02:00
Jeroen Engels
64fd5fd49b Bump elm-test to v2 2022-10-12 16:21:44 +02:00
Jeroen Engels
2fb55010fc Backport rules from elm-review-common 2022-09-19 12:01:49 +02:00
Jeroen Engels
4dd3bb5dff Backport rules from elm-review-unused 2022-09-19 11:54:35 +02:00
Jeroen Engels
6e883bca87 Filter ignored files and set rule name before caching errors 2022-09-18 00:24:24 +02:00
Jeroen Engels
e726935135 Speed up computeModules 2022-09-17 21:46:20 +02:00
Jeroen Engels
c931c47c81 Speed up runReview 2022-09-17 21:34:48 +02:00
Jeroen Engels
2332828230 Speed up errorsFromCache 2022-09-17 21:34:48 +02:00
Jeroen Engels
913f11f5e4 Add tests for ignored files 2022-09-17 21:34:48 +02:00
Jeroen Engels
a37d5afedc Backport rules from elm-review-forbidden-words 2022-09-01 18:00:56 +02:00
Jeroen Engels
f9e1d8aef8 Backport rules from Simplify 2022-09-01 16:22:25 +02:00
Jeroen Engels
3ef7727ae7 Backport rules from elm-review-documentation 2022-08-24 18:31:28 +02:00
Jeroen Engels
faef56d338 Backport rules from elm-review-unused 2022-08-24 18:10:58 +02:00
Jeroen Engels
b4f11c5ddf
Fix ModuleNameLookupTable resolving to indirect dependencies (#135) 2022-08-23 17:09:29 +02:00
Jeroen Engels
2a211e9d22 Use direct dependencies visitor in test rules 2022-08-22 21:49:08 +02:00
Jeroen Engels
d746a21c9a Add withDirectDependencies visitors 2022-08-22 21:49:08 +02:00
Jeroen Engels
67c9eecd29 Simplify NoUnused.Exports 2022-08-08 13:45:43 +02:00
Jeroen Engels
d0f804fbaa Use withFullAst in NoUnused.Exports 2022-08-08 10:39:50 +02:00
Jeroen Engels
fc8d1aac9f Add withModuleDocumentation 2022-08-08 10:39:50 +02:00
Jeroen Engels
8b6d539239 Add Rule.withFullAst 2022-08-08 10:39:50 +02:00
Jeroen Engels
350300e0c9
Add Rule.withModuleDocumentationVisitor (#132) 2022-08-07 13:36:28 +02:00
ScribblyBirb
9bdc37b98c
Fix flipped error message in global error details test failure (#130)
Error message for `unexpectedGlobalErrorDetails` and
`unexpectedConfigurationErrorDetails` had their expected and actual
details flipped.
2022-07-17 09:39:30 +02:00
Jeroen Engels
187e8a34be Backport NoDeprecated 2022-06-29 23:42:52 +02:00
Jeroen Engels
ab41f236bd Fix typo in test failure message 2022-06-22 22:37:48 +02:00
Jeroen Engels
e290a15b3a Change the wording for emptyDetails 2022-06-22 22:37:48 +02:00
Jeroen Engels
d90bfb46cb Add test for unexpectedConfigurationErrorDetails 2022-06-22 22:37:48 +02:00
Jeroen Engels
fae198f186 Make test failure message's order consistent 2022-06-22 22:37:48 +02:00
Jeroen Engels
70d430ae5c Use qualified Rule.Error in examples 2022-06-21 17:43:44 +02:00
Jeroen Engels
ca3c4e7cd7 Change test title 2022-06-20 19:25:41 +02:00
Jeroen Engels
f79e970019 Change default file paths for files in tests 2022-06-20 19:25:41 +02:00
Jeroen Engels
3ff9098d30 Add fullModuleNameAt and fullModuleNameFor in ModuleNameLookupTable 2022-05-01 20:26:20 +02:00
Jeroen Engels
dddba5c1cf Stop using Rule.withMetadata in plugin rules 2022-04-28 13:25:24 +02:00
Jeroen Engels
0fa1005f4d Use new context creator functions 2022-04-28 13:25:24 +02:00
Jeroen Engels
d17d995f0e Add Rule.withModuleName 2022-04-28 11:51:14 +02:00
Jeroen Engels
319ecb29a6 Add Rule.withFilePath 2022-04-28 11:41:01 +02:00
Jeroen Engels
8ab6272a39 Backport rules from other packages 2022-04-22 22:04:13 +02:00
Jie
2bc6c2ec33
Add Rule.filterErrorsForFiles (#115) 2022-02-04 17:16:08 +01:00
Jie
bbc6ce4365
Small typos (#116)
* tat -> that

* yoy -> you
2022-01-19 14:28:42 +01:00
SiriusStarr
a4816ddc11 Modify test for declaration list to check order 2022-01-05 20:46:47 +01:00
Jeroen Engels
0deab17a61 Simplify WithCommentsVisitorTest 2022-01-05 16:56:16 +01:00
SiriusStarr
3068ead8f4 Add failing test for withCommentsVisitor
Ensure that only non-parsed doc comments are passed and they are done so
in source order.
2022-01-05 16:55:35 +01:00
SiriusStarr
f643cae09e Add missing test for comment visitor order
Previously, the order of comment visitors was untested, despite being
claimed to occur at a specific point in the documentation (before import
visitor).
2022-01-05 16:46:42 +01:00
Jeroen Engels
b71984aebb Backport rules from elm-review-unused 2021-10-24 00:38:58 +02:00
Jeroen Engels
28a3973272 Backport rules from elm-review-common 2021-10-17 10:00:47 +02:00
SiriusStarr
2a8dbaf2a1
Add ModuleNameLookupTable support for operators (#106) 2021-10-03 11:03:00 +02:00
Jeroen Engels
34798e3f49 Backport elm-review-documentation 2021-10-02 10:32:41 +02:00
Jeroen Engels
7e6cd42469 Backport rules 2021-08-19 20:57:33 +02:00