mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-11-29 01:24:35 +03:00
Remove unused code
This commit is contained in:
parent
306b8f1b7b
commit
0454d5edd4
11
src/Glob.elm
11
src/Glob.elm
@ -1,5 +1,5 @@
|
|||||||
module Glob exposing
|
module Glob exposing
|
||||||
( Glob, fromString, never
|
( Glob, fromString
|
||||||
, match
|
, match
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -7,7 +7,7 @@ module Glob exposing
|
|||||||
|
|
||||||
[glob]: https://en.wikipedia.org/wiki/Glob_%28programming%29
|
[glob]: https://en.wikipedia.org/wiki/Glob_%28programming%29
|
||||||
|
|
||||||
@docs Glob, fromString, never
|
@docs Glob, fromString
|
||||||
@docs match
|
@docs match
|
||||||
|
|
||||||
-}
|
-}
|
||||||
@ -70,13 +70,6 @@ matchComponents components segments =
|
|||||||
False
|
False
|
||||||
|
|
||||||
|
|
||||||
{-| A `glob` that never matches.
|
|
||||||
-}
|
|
||||||
never : Glob
|
|
||||||
never =
|
|
||||||
Glob []
|
|
||||||
|
|
||||||
|
|
||||||
{-| Parse a string into a `glob`.
|
{-| Parse a string into a `glob`.
|
||||||
-}
|
-}
|
||||||
fromString : String -> Result (List Parser.DeadEnd) Glob
|
fromString : String -> Result (List Parser.DeadEnd) Glob
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
module Review.Cache.ContentHash exposing (ContentHash, combine, hash, nil)
|
module Review.Cache.ContentHash exposing (ContentHash, combine, hash)
|
||||||
|
|
||||||
import Dict exposing (Dict)
|
import Dict exposing (Dict)
|
||||||
import Vendor.Murmur3 as Murmur3
|
import Vendor.Murmur3 as Murmur3
|
||||||
@ -8,11 +8,6 @@ type ContentHash
|
|||||||
= ContentHash Int
|
= ContentHash Int
|
||||||
|
|
||||||
|
|
||||||
nil : ContentHash
|
|
||||||
nil =
|
|
||||||
ContentHash 0
|
|
||||||
|
|
||||||
|
|
||||||
hash : String -> ContentHash
|
hash : String -> ContentHash
|
||||||
hash source =
|
hash source =
|
||||||
ContentHash (Murmur3.hashString 0 source)
|
ContentHash (Murmur3.hashString 0 source)
|
||||||
|
@ -14,7 +14,7 @@ module Review.Cache.ExtraFile exposing
|
|||||||
|
|
||||||
-}
|
-}
|
||||||
|
|
||||||
import Review.Cache.ContentHash as ContentHash exposing (ContentHash)
|
import Review.Cache.ContentHash exposing (ContentHash)
|
||||||
import Review.Cache.ContextHash as ContextHash exposing (ComparableContextHash, ContextHash)
|
import Review.Cache.ContextHash as ContextHash exposing (ComparableContextHash, ContextHash)
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ module Review.Cache.Module exposing
|
|||||||
|
|
||||||
-}
|
-}
|
||||||
|
|
||||||
import Review.Cache.ContentHash as ContentHash exposing (ContentHash)
|
import Review.Cache.ContentHash exposing (ContentHash)
|
||||||
import Review.Cache.ContextHash as ContextHash exposing (ComparableContextHash, ContextHash)
|
import Review.Cache.ContextHash as ContextHash exposing (ComparableContextHash, ContextHash)
|
||||||
import Review.RequestedData exposing (RequestedData(..))
|
import Review.RequestedData exposing (RequestedData(..))
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ module Review.Cache.ProjectFile exposing
|
|||||||
|
|
||||||
-}
|
-}
|
||||||
|
|
||||||
import Review.Cache.ContentHash as ContentHash exposing (ContentHash)
|
import Review.Cache.ContentHash exposing (ContentHash)
|
||||||
import Review.Cache.ContextHash as ContextHash exposing (ComparableContextHash, ContextHash)
|
import Review.Cache.ContextHash as ContextHash exposing (ComparableContextHash, ContextHash)
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ module Review.FilePattern exposing
|
|||||||
, include, exclude, excludeDirectory
|
, include, exclude, excludeDirectory
|
||||||
, compact, match
|
, compact, match
|
||||||
, toStrings
|
, toStrings
|
||||||
|
, Summary
|
||||||
)
|
)
|
||||||
|
|
||||||
{-| A module for selecting multiple files from the file system
|
{-| A module for selecting multiple files from the file system
|
||||||
|
@ -67,7 +67,6 @@ import Review.Project.Dependency as Dependency exposing (Dependency)
|
|||||||
import Review.Project.Internal as Internal exposing (Project, ProjectInternals)
|
import Review.Project.Internal as Internal exposing (Project, ProjectInternals)
|
||||||
import Review.Project.ProjectCache as ProjectCache
|
import Review.Project.ProjectCache as ProjectCache
|
||||||
import Review.Project.ProjectModule as ProjectModule
|
import Review.Project.ProjectModule as ProjectModule
|
||||||
import Vendor.IntDict exposing (before)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -315,7 +315,6 @@ import Elm.Syntax.ModuleName exposing (ModuleName)
|
|||||||
import Elm.Syntax.Node as Node exposing (Node(..))
|
import Elm.Syntax.Node as Node exposing (Node(..))
|
||||||
import Elm.Syntax.Pattern exposing (Pattern)
|
import Elm.Syntax.Pattern exposing (Pattern)
|
||||||
import Elm.Syntax.Range as Range exposing (Range)
|
import Elm.Syntax.Range as Range exposing (Range)
|
||||||
import Glob exposing (Glob)
|
|
||||||
import Json.Encode as Encode
|
import Json.Encode as Encode
|
||||||
import Review.Cache.ContentHash exposing (ContentHash)
|
import Review.Cache.ContentHash exposing (ContentHash)
|
||||||
import Review.Cache.ContextHash as ContextHash exposing (ComparableContextHash, ContextHash)
|
import Review.Cache.ContextHash as ContextHash exposing (ComparableContextHash, ContextHash)
|
||||||
@ -328,7 +327,7 @@ import Review.Error exposing (InternalError)
|
|||||||
import Review.Exceptions as Exceptions exposing (Exceptions)
|
import Review.Exceptions as Exceptions exposing (Exceptions)
|
||||||
import Review.FilePath exposing (FilePath)
|
import Review.FilePath exposing (FilePath)
|
||||||
import Review.FilePattern as FilePattern exposing (FilePattern)
|
import Review.FilePattern as FilePattern exposing (FilePattern)
|
||||||
import Review.Fix as Fix exposing (Fix, FixResult(..))
|
import Review.Fix as Fix exposing (Fix)
|
||||||
import Review.Fix.FixProblem as FixProblem
|
import Review.Fix.FixProblem as FixProblem
|
||||||
import Review.Fix.FixedErrors as FixedErrors exposing (FixedErrors)
|
import Review.Fix.FixedErrors as FixedErrors exposing (FixedErrors)
|
||||||
import Review.Fix.Internal as InternalFix
|
import Review.Fix.Internal as InternalFix
|
||||||
@ -347,7 +346,6 @@ import Review.Project.Valid as ValidProject exposing (ValidProject)
|
|||||||
import Review.RequestedData as RequestedData exposing (RequestedData(..))
|
import Review.RequestedData as RequestedData exposing (RequestedData(..))
|
||||||
import Vendor.Graph as Graph exposing (Graph)
|
import Vendor.Graph as Graph exposing (Graph)
|
||||||
import Vendor.IntDict as IntDict
|
import Vendor.IntDict as IntDict
|
||||||
import Vendor.ListExtra as ListExtra
|
|
||||||
import Vendor.Zipper as Zipper exposing (Zipper)
|
import Vendor.Zipper as Zipper exposing (Zipper)
|
||||||
|
|
||||||
|
|
||||||
@ -419,12 +417,6 @@ type alias ExtraFileRequest =
|
|||||||
Result (List String) (List { files : List { pattern : String, included : Bool }, excludedDirectories : List String })
|
Result (List String) (List { files : List { pattern : String, included : Bool }, excludedDirectories : List String })
|
||||||
|
|
||||||
|
|
||||||
type alias StringableGlob =
|
|
||||||
{ glob : Glob
|
|
||||||
, string : String
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- REVIEWING
|
-- REVIEWING
|
||||||
|
|
||||||
@ -1201,11 +1193,6 @@ compactExtraFilesVisitor maybeExtraFilesVisitor =
|
|||||||
Nothing
|
Nothing
|
||||||
|
|
||||||
|
|
||||||
globMatch : List Glob -> { a | path : String } -> Bool
|
|
||||||
globMatch globs file =
|
|
||||||
List.any (\glob -> Glob.match glob file.path) globs
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- PROJECT RULES
|
-- PROJECT RULES
|
||||||
|
|
||||||
@ -2056,65 +2043,6 @@ withExtraFilesProjectVisitor baseVisitor filePatterns (ProjectRuleSchema schema)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
parseGlobs : List String -> Result (List String) (List StringableGlob)
|
|
||||||
parseGlobs requestedFiles =
|
|
||||||
requestedFiles
|
|
||||||
|> List.map
|
|
||||||
(\str ->
|
|
||||||
Glob.fromString str
|
|
||||||
|> Result.map (\glob -> { glob = glob, string = str })
|
|
||||||
|> Result.mapError (always str)
|
|
||||||
)
|
|
||||||
|> toResults
|
|
||||||
|
|
||||||
|
|
||||||
combineGlobs : Result appendable appendable -> Result appendable appendable -> Result appendable appendable
|
|
||||||
combineGlobs previous new =
|
|
||||||
case ( previous, new ) of
|
|
||||||
( Ok previousGlobs, Ok newGlobs ) ->
|
|
||||||
Ok (previousGlobs ++ newGlobs)
|
|
||||||
|
|
||||||
( Err previousErrors, Err newErrors ) ->
|
|
||||||
Err (previousErrors ++ newErrors)
|
|
||||||
|
|
||||||
( Err errors, _ ) ->
|
|
||||||
previous
|
|
||||||
|
|
||||||
( _, Err _ ) ->
|
|
||||||
new
|
|
||||||
|
|
||||||
|
|
||||||
toResults : List (Result String a) -> Result (List String) (List a)
|
|
||||||
toResults results =
|
|
||||||
toResultsHelp results []
|
|
||||||
|
|
||||||
|
|
||||||
toResultsHelp : List (Result String a) -> List a -> Result (List String) (List a)
|
|
||||||
toResultsHelp results acc =
|
|
||||||
case results of
|
|
||||||
[] ->
|
|
||||||
Ok acc
|
|
||||||
|
|
||||||
(Ok result) :: rest ->
|
|
||||||
toResultsHelp rest (result :: acc)
|
|
||||||
|
|
||||||
(Err str) :: rest ->
|
|
||||||
collectErrs rest [ str ]
|
|
||||||
|
|
||||||
|
|
||||||
collectErrs : List (Result error value) -> List error -> Result (List error) never
|
|
||||||
collectErrs results acc =
|
|
||||||
case results of
|
|
||||||
[] ->
|
|
||||||
Err acc
|
|
||||||
|
|
||||||
(Err str) :: rest ->
|
|
||||||
collectErrs rest (str :: acc)
|
|
||||||
|
|
||||||
(Ok _) :: rest ->
|
|
||||||
collectErrs rest []
|
|
||||||
|
|
||||||
|
|
||||||
{-| Add a visitor to the [`ProjectRuleSchema`](#ProjectRuleSchema) which will examine the project's
|
{-| Add a visitor to the [`ProjectRuleSchema`](#ProjectRuleSchema) which will examine the project's
|
||||||
[dependencies](./Review-Project-Dependency).
|
[dependencies](./Review-Project-Dependency).
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user