-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error message when failing to update a suppression file
- Loading branch information
Showing
13 changed files
with
239 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"type": "application", | ||
"source-directories": [ | ||
"src" | ||
], | ||
"elm-version": "0.19.1", | ||
"dependencies": { | ||
"direct": { | ||
"elm/browser": "1.0.2", | ||
"elm/core": "1.0.5", | ||
"elm/html": "1.0.0" | ||
}, | ||
"indirect": { | ||
"elm/json": "1.1.3", | ||
"elm/time": "1.0.0", | ||
"elm/url": "1.0.0", | ||
"elm/virtual-dom": "1.0.2" | ||
} | ||
}, | ||
"test-dependencies": { | ||
"direct": {}, | ||
"indirect": {} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
test/project-with-suppressed-errors-no-write/expected-NoUnused.Variables.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"version": 1, | ||
"automatically created by": "elm-review suppress", | ||
"learn more": "elm-review suppress --help", | ||
"suppressions": [ | ||
{ "count": 2, "filePath": "src/Main.elm" } | ||
] | ||
} |
24 changes: 24 additions & 0 deletions
24
test/project-with-suppressed-errors-no-write/fixed-elm.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"type": "application", | ||
"source-directories": [ | ||
"src" | ||
], | ||
"elm-version": "0.19.1", | ||
"dependencies": { | ||
"direct": { | ||
"elm/browser": "1.0.2", | ||
"elm/core": "1.0.5", | ||
"elm/html": "1.0.0" | ||
}, | ||
"indirect": { | ||
"elm/json": "1.1.3", | ||
"elm/time": "1.0.0", | ||
"elm/url": "1.0.0", | ||
"elm/virtual-dom": "1.0.2" | ||
} | ||
}, | ||
"test-dependencies": { | ||
"direct": {}, | ||
"indirect": {} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
test/project-with-suppressed-errors-no-write/review/elm.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"type": "application", | ||
"source-directories": [ | ||
"src" | ||
], | ||
"elm-version": "0.19.1", | ||
"dependencies": { | ||
"direct": { | ||
"elm/core": "1.0.5", | ||
"elm/json": "1.1.3", | ||
"elm/project-metadata-utils": "1.0.2", | ||
"jfmengels/elm-review": "2.13.0", | ||
"jfmengels/elm-review-unused": "1.1.29", | ||
"stil4m/elm-syntax": "7.2.9" | ||
}, | ||
"indirect": { | ||
"elm/bytes": "1.0.8", | ||
"elm/html": "1.0.0", | ||
"elm/parser": "1.1.0", | ||
"elm/random": "1.0.0", | ||
"elm/time": "1.0.0", | ||
"elm/virtual-dom": "1.0.3", | ||
"elm-community/list-extra": "8.7.0", | ||
"elm-explorations/test": "2.1.1", | ||
"miniBill/elm-unicode": "1.0.3", | ||
"rtfeldman/elm-hex": "1.0.0", | ||
"stil4m/structured-writer": "1.0.3" | ||
} | ||
}, | ||
"test-dependencies": { | ||
"direct": {}, | ||
"indirect": {} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
test/project-with-suppressed-errors-no-write/review/src/ReviewConfig.elm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module ReviewConfig exposing (config) | ||
|
||
{-| Do not rename the ReviewConfig module or the config function, because | ||
`elm-review` will look for these. | ||
To add packages that contain rules, add them to this review project using | ||
`elm install author/packagename` | ||
when inside the directory containing this file. | ||
-} | ||
|
||
|
||
import NoUnused.Dependencies | ||
import NoUnused.Variables | ||
import Review.Rule exposing (Rule) | ||
|
||
|
||
config : List Rule | ||
config = | ||
[ NoUnused.Dependencies.rule | ||
, NoUnused.Variables.rule | ||
] |
9 changes: 9 additions & 0 deletions
9
test/project-with-suppressed-errors-no-write/review/suppressed/NoUnused.Variables.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"version": 1, | ||
"automatically created by": "elm-review suppress", | ||
"learn more": "elm-review suppress --help", | ||
"suppressions": [ | ||
{ "count": 2, "filePath": "src/Main.elm" }, | ||
{ "count": 1, "filePath": "src/OtherFile.elm" } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
module Main exposing (main) | ||
|
||
import Browser | ||
import Folder.Used exposing (one) | ||
import Html | ||
exposing | ||
( Html | ||
, button | ||
, div | ||
, -- h1 is unused | ||
h1 | ||
, -- span is unused | ||
span | ||
, text | ||
) | ||
import Html.Events exposing (onClick) | ||
|
||
|
||
type alias Model = | ||
{ count : Int } | ||
|
||
|
||
initialModel : Model | ||
initialModel = | ||
{ count = 0 } | ||
|
||
|
||
type Msg | ||
= Increment | ||
| Decrement | ||
|
||
|
||
update : Msg -> Model -> Model | ||
update msg model = | ||
case msg of | ||
Increment -> | ||
{ model | count = model.count + one } | ||
|
||
Decrement -> | ||
{ model | count = model.count - 1 } | ||
|
||
|
||
view : Model -> Html Msg | ||
view model = | ||
div [] | ||
[ button [ onClick Increment ] [ text "+1" ] | ||
, div [] [ text <| String.fromInt model.count ] | ||
, button [ onClick Decrement ] [ text "-1" ] | ||
] | ||
|
||
|
||
main : Program () Model Msg | ||
main = | ||
Browser.sandbox | ||
{ init = initialModel | ||
, view = view | ||
, update = update | ||
} |
5 changes: 5 additions & 0 deletions
5
test/project-with-suppressed-errors-no-write/src/OtherFile.elm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module OtherFile exposing (a) | ||
|
||
|
||
a = | ||
1 |
13 changes: 13 additions & 0 deletions
13
test/project-with-suppressed-errors-no-write/with-errors-OtherFile.elm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module OtherFile exposing (a) | ||
|
||
|
||
a = | ||
1 | ||
|
||
|
||
b = | ||
2 | ||
|
||
|
||
c = | ||
3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-- FAILED TO UPDATE SUPPRESSION FILE ------------------------------------------- | ||
|
||
I tried updating the suppression file in the review/suppressed/ folder, but failed to write to review/suppressed/NoUnused.Variables.json. | ||
|
||
Please check that elm-review has write permissions to that file and folder. In case it helps, here's the error I encountered: | ||
|
||
Error: EACCES: permission denied, open '<local-path>/test/project-with-suppressed-errors-no-write/review/suppressed/NoUnused.Variables.json' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters