Add elm-review

This commit is contained in:
Ju Liu 2022-03-15 16:59:55 +00:00
parent d0a7f520f3
commit d88a371b0e
3 changed files with 79 additions and 1 deletions

35
review/elm.json Normal file
View File

@ -0,0 +1,35 @@
{
"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.7.0",
"jfmengels/elm-review-unused": "1.1.20",
"stil4m/elm-syntax": "7.2.9"
},
"indirect": {
"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.2",
"elm-community/list-extra": "8.5.2",
"elm-explorations/test": "1.2.2",
"miniBill/elm-unicode": "1.0.2",
"rtfeldman/elm-hex": "1.0.0",
"stil4m/structured-writer": "1.0.3"
}
},
"test-dependencies": {
"direct": {
"elm-explorations/test": "1.2.2"
},
"indirect": {}
}
}

View File

@ -0,0 +1,39 @@
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.CustomTypeConstructorArgs
import NoUnused.CustomTypeConstructors
import NoUnused.Dependencies
import NoUnused.Exports
import NoUnused.Modules
import NoUnused.Parameters
import NoUnused.Patterns
import NoUnused.Variables
import Review.Rule exposing (Rule)
config : List Rule
config =
[ NoUnused.CustomTypeConstructors.rule []
, NoUnused.CustomTypeConstructorArgs.rule
, NoUnused.Dependencies.rule
-- We want to include all functions even if they're unused in this repository.
-- , NoUnused.Exports.rule
, NoUnused.Modules.rule
-- We like to keep parameters around for readability.
-- , NoUnused.Parameters.rule
-- , NoUnused.Patterns.rule
, NoUnused.Variables.rule
]

View File

@ -1,6 +1,9 @@
let
sources = import ./nix/sources.nix;
system = if builtins.currentSystem == "aarch64-darwin" then "x86_64-darwin" else builtins.currentSystem;
system = if builtins.currentSystem == "aarch64-darwin" then
"x86_64-darwin"
else
builtins.currentSystem;
nixpkgs = import sources.nixpkgs { inherit system; };
niv = nixpkgs.callPackage sources.niv { };
in with nixpkgs;
@ -25,6 +28,7 @@ stdenv.mkDerivation {
elmPackages.elm-format
elmPackages.elm-test
elmPackages.elm-verify-examples
elmPackages.elm-review
(pkgs.callPackage sources.elm-forbid-import { })
# preview dependencies