Jeroen Engels
0d39bcf2d0
Rename Lint.Fix.Result to Lint.Fix.FixResult
...
This is to avoid confusion with the core Result type when seeing
signatures like `a : b -> Result`
2019-08-22 09:35:24 +02:00
Jeroen Engels
86f3a24a52
Adapt to the addition of background colors in elm-lint-reporter
2019-08-21 22:15:25 +02:00
Jeroen Engels
50e3ccdb36
Forbid calling withFinalEvaluation if the Schema has no visitors
2019-08-21 18:12:56 +02:00
Jeroen Engels
afe531946e
Rename Lint.LintError to Lint.Error
2019-08-19 17:29:23 +02:00
Jeroen Engels
7c90ffe38a
Rename Lint.lintSource to Lint.lint
2019-08-19 17:15:10 +02:00
Jeroen Engels
845d462c78
Re-organize documentation in Lint.elm
2019-08-19 17:09:39 +02:00
Jeroen Engels
dc0fbefde6
Remove unused parameter
2019-08-19 17:08:28 +02:00
Jeroen Engels
574eb55023
Ignore .coverage in Git
2019-08-19 17:06:27 +02:00
Jeroen Engels
7aa09c1b82
Handle GLSLExpression as a node that can't hold an expression
...
A node of type GLSLExpression does not hold contain children
expressions, contrary to what i understood before. This change should
remove the confusion around that.
2019-08-19 17:06:05 +02:00
Jeroen Engels
2c38878a6d
Autofix all unused variables in NoUnusedVariables
2019-08-19 16:13:45 +02:00
Jeroen Engels
aa27b91141
Adapt to Report.formatReport API change
2019-08-19 11:24:52 +02:00
Jeroen Engels
8963ea42ac
Rename Lint.fixes to Lint.errorFixes
2019-08-18 23:58:11 +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
b70c9f4e5d
Fix example code
2019-08-09 19:31:03 +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
ac93b84586
Bump elm-format to v0.8.2
2019-08-09 10:35:09 +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
72fbe07fdd
Add a short section about test titles
2019-08-07 20:58:24 +02:00
Jeroen Engels
b877693cdf
Add documentation for Fix
2019-08-06 09:31:57 +02:00
Jeroen Engels
55d17ee5ef
Replace use Node.value and Node.range by pattern matching
...
I just noticed that the constructor for Node was exposed, and this can
make the code easier to write.
2019-08-06 09:31:57 +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
b973e90936
Change fixedSource to a list of fixes in the different errors
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
7f6580d1fd
Tiny clean up/refactor in the applyReplace function
2019-08-06 09:31:57 +02:00
Jeroen Engels
c5d706f739
Perf: Do not split source into lines at every fix
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
9283ee5d8b
Expose Lint.Fix as part of the public API
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
df840de3d6
NoUnusedVariable: Automatic fix a var of type Variable by removing it
2019-08-04 11:14:16 +02:00
Jeroen Engels
1ac02ebde6
Make fixes a lazy function
...
This prevents having to do a heavy computation when it is not needed.
2019-08-03 14:02:49 +02:00
Jeroen Engels
f5b689b0ec
Make fixes a Maybe, so that we can know whether fixes were provided
2019-08-03 14:02:49 +02:00
Jeroen Engels
007472a29c
Add Lint.Rule.withFixes
2019-08-03 11:43:32 +02:00
Jeroen Engels
24e71626cf
Create the Lint.Fix module, to handle fixes to the source code
2019-08-03 01:19:12 +02:00
Jeroen Engels
bc4b7fef00
Get some very simple fixing
2019-08-03 00:21:14 +02:00
Jeroen Engels
4831498a57
Add travis badge
2019-08-01 09:30:40 +02:00
Jeroen Engels
d60662279c
SImplify test command
...
"elm make --docs" already run compiler checks, no need for an additional
"elm make"
2019-08-01 09:20:23 +02:00
Jeroen Engels
c1c0eafb01
Run tests in Travis
2019-07-31 21:01:48 +02:00
Jeroen Engels
e2f669a337
Run elm-format when running testing
2019-07-31 21:00:36 +02:00
Jeroen Engels
8327eb4280
Update Lint.Test to API changes
...
It was missing the changes on LintError being opaque and the file name
being renamed to path
2019-07-31 21:00:16 +02:00
Jeroen Engels
a8c3d2cc71
Remove unused dependency in example
2019-07-31 09:51:59 +02:00
Jeroen Engels
f102759274
Upgrade dependencies
2019-07-31 09:49:29 +02:00
Jeroen Engels
5d297822ca
Store the module name in the error, to send it to the reporter
2019-07-31 00:50:35 +02:00
Jeroen Engels
4b9e2ae8d9
Rename the file's name field to path
...
This is a more accurate name for a field that is like
"src/Folder/File.elm"
2019-07-31 00:08:16 +02:00
Jeroen Engels
24f52dd660
Clean: Move functions around
2019-07-30 23:29:39 +02:00
Jeroen Engels
02985ff109
Example: Use reporter from elm-lint-reporter
...
Basically, the contents of Reporter and Text were moved there. This will
be useful to share the reporter with the CLI.
2019-07-30 23:18:52 +02:00
Jeroen Engels
e937feb91f
Example: Fix source code and linting errors being out of sync
2019-07-30 21:01:38 +02:00