diff --git a/cmd/version.go b/cmd/version.go index 9bf9baee1..5c292af1f 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -25,7 +25,7 @@ func VersionCmd(commit string) *cli.Command { version := c.App.Version res, err := http.Get("https://github.com/bruin-data/bruin/releases/latest") //nolint - defer res.Body.Close() //nolint + defer res.Body.Close() //nolint:all if err != nil { return errors.Wrap(err, "failed to check the latest version") } diff --git a/pkg/lint/list.go b/pkg/lint/list.go index 0584b19f0..1ef71c053 100644 --- a/pkg/lint/list.go +++ b/pkg/lint/list.go @@ -160,14 +160,6 @@ func GetRules(fs afero.Fs, finder repoFinder, excludeWarnings bool) ([]Rule, err AssetValidator: ValidateDuplicateColumnNames, ApplicableLevels: []Level{LevelPipeline, LevelAsset}, }, - &SimpleRule{ - Identifier: "invalid-python-module-name", - Fast: true, - Severity: ValidatorSeverityCritical, - Validator: CallFuncForEveryAsset(ValidateInvalidPythonModuleName), - AssetValidator: ValidateInvalidPythonModuleName, - ApplicableLevels: []Level{LevelPipeline, LevelAsset}, - }, &SimpleRule{ Identifier: "assets-directory-exist", Fast: true, diff --git a/pkg/lint/rules.go b/pkg/lint/rules.go index e6695ba8e..dce75a812 100644 --- a/pkg/lint/rules.go +++ b/pkg/lint/rules.go @@ -375,24 +375,6 @@ func ValidateDuplicateColumnNames(ctx context.Context, p *pipeline.Pipeline, ass return issues, nil } -func ValidateInvalidPythonModuleName(ctx context.Context, p *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error) { - var issues []*Issue - - if asset.Type == "python" { - parentDirs := strings.Split(filepath.Dir(asset.DefinitionFile.Path), "/") - lastDir := parentDirs[len(parentDirs)-1] - - // Check if the last directory contains a hyphen and is not in the 'assets' directory - if strings.Contains(lastDir, "-") && lastDir != "assets" { - issues = append(issues, &Issue{ - Task: asset, - Description: fmt.Sprintf("Invalid Python module name '%s' for asset '%s'. Directory names cannot contain hyphens ('-') as they cannot be imported in Python.", lastDir, asset.Name), - }) - } - } - return issues, nil -} - func ValidateAssetDirectoryExist(p *pipeline.Pipeline) ([]*Issue, error) { var issues []*Issue