Skip to content
This repository has been archived by the owner on Apr 1, 2022. It is now read-only.

Commit

Permalink
Ignore vendor/ directories in golang strategies (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnr authored Feb 25, 2020
1 parent bef733d commit f4e7c26
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Strategy/Go/GoList.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import Strategy.Go.Types
import Types

discover :: HasDiscover sig m => Path Abs Dir -> m ()
discover = walk $ \_ _ files -> do
discover = walk $ \_ subdirs files -> do
case find (\f -> fileName f == "go.mod") files of
Nothing -> pure ()
Just file -> runSimpleStrategy "golang-golist" GolangGroup $ analyze (parent file)

walkContinue
walkSkipNamed ["vendor/"] subdirs

data Require = Require
{ reqPackage :: Text
Expand Down
4 changes: 2 additions & 2 deletions src/Strategy/Go/Gomod.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ import Strategy.Go.Types
import Types

discover :: HasDiscover sig m => Path Abs Dir -> m ()
discover = walk $ \_ _ files -> do
discover = walk $ \_ subdirs files -> do
case find (\f -> fileName f == "go.mod") files of
Nothing -> pure ()
Just file -> runSimpleStrategy "golang-gomod" GolangGroup $ analyze file

walkContinue
walkSkipNamed ["vendor/"] subdirs

data Statement =
RequireStatement Text Text -- ^ package, version
Expand Down
4 changes: 2 additions & 2 deletions src/Strategy/Go/GopkgLock.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ import Toml (TomlCodec, (.=))
import Types

discover :: HasDiscover sig m => Path Abs Dir -> m ()
discover = walk $ \_ _ files -> do
discover = walk $ \_ subdirs files -> do
case find (\f -> fileName f == "Gopkg.lock") files of
Nothing -> pure ()
Just file -> runSimpleStrategy "golang-gopkglock" GolangGroup $ analyze file

walkContinue
walkSkipNamed ["vendor/"] subdirs

golockCodec :: TomlCodec GoLock
golockCodec = GoLock
Expand Down
4 changes: 2 additions & 2 deletions src/Strategy/Go/GopkgToml.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ import Strategy.Go.Types
import Types

discover :: HasDiscover sig m => Path Abs Dir -> m ()
discover = walk $ \_ _ files -> do
discover = walk $ \_ subdirs files -> do
case find (\f -> fileName f == "Gopkg.toml") files of
Nothing -> pure ()
Just file -> runSimpleStrategy "golang-gopkgtoml" GolangGroup $ analyze file

walkContinue
walkSkipNamed ["vendor/"] subdirs

gopkgCodec :: TomlCodec Gopkg
gopkgCodec = Gopkg
Expand Down

0 comments on commit f4e7c26

Please sign in to comment.