Skip to content

Commit

Permalink
refactor(fanal): use const for environment.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen committed Apr 27, 2024
1 parent 32b7ae2 commit a3254f9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (a environmentAnalyzer) Analyze(_ context.Context, input analyzer.AnalysisI
return res, nil
}
func (a environmentAnalyzer) Required(filePath string, _ os.FileInfo) bool {
return filepath.Base(filePath) == "environment.yaml" || filepath.Base(filePath) == "environment.yml"
return filepath.Base(filePath) == types.CondaEnvYml || filepath.Base(filePath) == types.CondaEnvYaml
}

func (a environmentAnalyzer) Type() analyzer.Type {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ func Test_environmentAnalyzer_Analyze(t *testing.T) {
},
},
{
Name: "_openmp_mutex",
Version: "5.1",
Name: "_openmp_mutex",
Locations: []types.Location{
{
StartLine: 6,
Expand Down
3 changes: 3 additions & 0 deletions pkg/fanal/types/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,7 @@ const (
PubSpecLock = "pubspec.lock"

MixLock = "mix.lock"

CondaEnvYaml = "environment.yaml"
CondaEnvYml = "environment.yml"
)

0 comments on commit a3254f9

Please sign in to comment.