2.15.1 - 2025-02-13
- Fixed an issue where the global error reporting duplicate module names would not have a name.
2.15.0 - 2025-02-11
The project now supports multi-file fixes as well as fixes that remove files through the following functions and types:
Review.Rule.withFixesV2
Review.Rule.FixV2
Review.Rule.editModule
Review.Rule.removeModule
Review.Rule.editElmJson
Review.Rule.editReadme
Review.Rule.editExtraFile
Review.Rule.removeExtraFile
In some places, Fix
has been renamed to Edit
(and a new Edit
type has been added as well) as that is a more apt name.
The types/functions will be renamed or removed to make the naming consistent and simpler in the next major version.
Edits where the start appears after the end now cause the fix to fail. Removal edits that overlap are now merged together and don't cause the fix to fail.
We are also adding a new convenience function Review.Rule.withModuleContextWithErrors
to report errors while in the fromModuleToProject
function. This can help avoid duplicate work that would otherwise be done in both the final module evaluation and in fromModuleToProject
.
Also adds (provided for the CLI):
Review.Rule.errorFixesV2
(replaceserrorFixes
)Review.Rule.errorFixProblem
(replaceserrorFixFailure
)Review.Options.withFileRemovalFixes
Review.Fix.FixProblem
(replacesReview.Fix.Problem
)Review.Project.diffV2
(replacesReview.Project.diff
)
New functions and types have been added to help test the new fix APIs.
Review.Test.shouldFixFiles
Review.Test.shouldFixFilesWithFileRemoval
Review.Test.expectGlobalErrorsWithFixes
Review.Test.globalErrorsWithFixes
Review.Test.ExpectedFix
Review.Test.edited
Review.Test.removed
Test failure messages around fixes have been improved significantly. It should now be much easier to figure out why a test failed.
Additionally, trailing whitespace at the end of a line in a provided source code is now ignored (no need to force these to be present trough String.replace
shenanigans).
Review.Rule.errorFixes
(replaced byerrorFixesV2
)Review.Rule.errorFixFailure
(replaced byerrorFixProblem
)Review.Fix.Problem
(replaced byReview.Fix.FixProblem
)Review.Rule.providesFixesForModuleRule
andReview.Rule.providesFixesForProjectRule
are now unnecessary. This information was used in the past to speed up fixes, but ended up not being useful later on.
2.14.1 - 2024-10-08
- Fixed an issue where extracting code using
Review.Rule.withSourceCodeExtractor
would not get the correct source code when source contains Unicode characters.
2.14.0 - 2024-06-14
Support new visitors that visit "extra files".
- Added
Review.Rule.withExtraFilesModuleVisitor
andReview.Rule.withExtraFilesProjectVisitor
to request access to arbitrary files that the project doesn't analyze by default. - Added new functions to report an error for an extra file and
Review.Rule.errorForExtraFile
andReview.Rule.errorForExtraFileWithFix
. - Added new functions to test errors reported for extra files:
Review.Test.expectErrorsForExtraFile
andReview.Test.extraFileErrors
. - Added new module
Review.FilePattern
to specify the files to analyze. - Added new functions in
Review.Project
to add/update/remove/get (extra) files - Moved the logic of the diffing of
Review.Project.Project
from the CLI to the package.
2.13.2 - 2024-04-09
Fixed an issue where the result of a module name lookup for let variables was sometimes incorrect. #171
2.13.1 - 2023-06-17
Fixed an issue where the module name lookup table would yield an incorrect result. #159
2.13.0 - 2023-04-16
- Changed the order in which rules are applied on modules. #153
Instead of visiting the entire project for each rule sequentially, we now visit the entire project once but apply each rule on each module. This should hopefully result in a small speed improvement, and make it more interesting to precompute interesting information to provide the rules (such as the module name lookup table)
- Made it less costly to compute whether cached analysis can be reused #154
The caching mechanism introduced in 2.11.0 felt inefficient. It improved the performance a bit but not as significantly as expected. The reason for that was that the method to check whether a cached analysis could be re-used or not was extremely inefficient. Changing the representation of that key vastly improved the performance of the whole cache system, which now feels worth it.
- Applying fixes for all targets #155
In 2.10.0 the package introduced the ability to apply fixes on its own, without the need of the CLI. It did however not
support applying fixes for the elm.json
file, as that can have important repercussions on the analysis (if
source-directories
or dependencies are changed). These fixes are now applied as well.
Applying all fixes in the package means that there is no need to try and apply fixes in the CLI, which will be removed in its v2.10.0.
The CLI was responsible for annotating fixes as failing, which is why this release introduces Review.Rule.errorFixFailure
to allow
the CLI to show when a fix failed to apply.
2.12.2 - 2023-02-02
Fixed a bug where errors were skipped/ignored when running elm-review
after having run elm-review --fix-all
#150
2.12.1 - 2023-01-25
Fixed a bug where rules would report false positives in the presence of the file-system cache.
2.12.0 - 2023-01-22
Fixed a bug that ignored fixes from rules that were not marked as providing fixes (using Rule.providesFixesFor*Rule
).
This was meant to be handled by the CLI, but didn't work as expected.
When the rule uses Review.Rule.withIsFileIgnored
, the test runner will now attempt to re-run the rule while ignoring
some files (it will do so for every possible combination) and assert that the results are the same. This is to
check that the knowledge is only used for performance improvements and change the result. This way, complex rules can
avoid writing extremely complicated test setups to test that complex scenarios work behave as expected even when some
files are ignored.
Some rules might not wish for this behavior, in which case Review.Test.ignoredFilesImpactResults
can be used to
opt out of this re-running mechanism.
2.11.1 - 2022-12-20
- Fix
Review.Rule.withIsFileIgnored
returning the wrong value.
2.11.0 - 2022-12-17
- Adds
Review.Rule.withIsFileIgnored
(#145) - Behind the scenes work to allow the CLI to save the internal result cache to the file system. Adds as an internal function
Review.Rule.withRuleId
for that purpose. - Fixed the test failure message reported when a test was missing an expected extract (it reported the failure message for a different problem).
2.10.0 - 2022-11-08
Includes a large rework of the internals to include fixes (instead of in the CLI) which results in much faster fixes. See the announcement blog post on the topic.
Breaking change (in the sense that tests will fail): Rules that provide fixes now have to indicate that they will do so,
by using Rule.providesFixesForModuleRule
or Rule.providesFixesForProjectRule
.
Rules can now include a "data extractor" using Rule.withDataExtractor
, which allows you to extract information from a
project if you run elm-review --extract --report=json
. See the "Extract information" section in the README for more
information.
The testing API provided in Review.Test
worked well, but in cases where you had to report multiple different things,
for instance errors for modules + global errors, then you would have to switch to using expectGlobalAndModuleErrors
.
If you reported local errors + global errors, you would have to use expectGlobalAndLocalErrors
, and so on.
With the addition of data extracts, this approach would require a few new functions, because we'd need a combination of all the possible things a rule would report for any given test.
Since this looked like a combinatorial explosion, we are now switching to a different approach. The two functions I just
mentioned are now deprecated, and some new functions are introduced to replace them using a more flexible approach,
center around the new Review.Test.expect
function.
2.9.2 - 2022-10-12
Bumps the dependency to elm-explorations/test
to v2.
We recommend upgrading by using elm-json
, like this:
cd review/
elm-json upgrade
2.9.1 - 2022-09-19
This release contains HUGE performance updates. elm-review
should now run quite a bit faster (rough estimate says 50%).
2.9.0 - 2022-08-23
- Adds
Review.Rule.withModuleDocumentationVisitor
(#132) - Adds
Review.Rule.withModuleDocumentation
(#133) - Adds
Review.Rule.withFullAst
(#133) - Adds
Review.ModuleNameLookupTable.createForTests
(d1c4102ec9113cd8e7fef1824554925e89d0b0f1) - Adds
Review.Rule.withDirectDependenciesModuleVisitor
andReview.Rule.withDirectDependenciesModuleVisitor
(#136) - Adds
Review.Project.directDependencies
(#136) - Fixes a bug in the
ModuleNameLookupTable
where the module name would not be resolved due to the presence of indirect dependencies (#135)
2.8.1 - 2022-07-17
- Fixes confusing test failure messages from the test module (9bdc37b98c5e29f00e9485cf78bce0a3ff715761)
2.8.0 - 2022-07-05
-
Adds
Review.ModuleNameLookupTable.fullModuleNameAt
andReview.ModuleNameLookupTable.fullModuleNameFor
(3ff9098d30bbd48a710bcc978c531b686b33c784) -
Adds
Review.Rule.withFilePath
(319ecb29a69ee8c35914b14827d7f068ed48669c) -
Adds
Review.Rule.withModuleName
(d17d995f0eae4e0455143027da50e17280286414) -
Adds
Review.Rule.withModuleNameNode
(0fe88c90cfee887c046a3765400c3883797a0bd3) -
Adds
Review.Rule.withIsInSourceDirectories
(e1e522eafbb389484adaca8c95642c9e14d15011) -
Deprecates
Review.Rule.Metadata
,Review.Rule.moduleNameFromMetadata
,Review.Rule.moduleNameNodeFromMetadata
andReview.Rule.isInSourceDirectories
(2c0254a4694bc4994127be8565744a4af9412605) -
Updated the way that deprecations functions and types were annotated so that
NoDeprecated
could report them. -
The path of a file when passed to a test module is now by default
src/<ModuleName>.elm
instead ofsrc/File_<index>.elm
(f79e9700192c73dafea215410c8f67f4fdd8ffd4) -
Updated some test failure messages from the test module so that they are always in the order "expected X but got Y" (fae198f186a7659fa98f6f3400bb57960be57b57)
2.7.2 - 2022-04-26
- Updated documentation to mention the [starter configurations](https://jfmengels.net/starter-configurations/
2.7.1 - 2022-03-18
- Fixed a bug where the module graph wasn't properly computed and would lead to outdated/unexpected results in watch or fix mode (648d386d9d812f95c200ce6b6d94b6f5c2dd168d)
2.7.0 - 2022-02-04
- Adds
Review.Rule.filterErrorsForFiles
(#115) (thanks @jiegillet!)
Help would be appreciated to fill the blanks!