mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-28 05:00:26 -04:00
Implement the first part of RFC 20250303-linter-policy (#2577)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
This commit is contained in:
@@ -32,11 +32,11 @@ go 1.22`)
|
||||
|
||||
tempDir := t.TempDir()
|
||||
dir := path.Join(tempDir, "testmethod-go")
|
||||
if err := os.MkdirAll(dir, 0700); err != nil { //nolint:mnd // This check is stupid
|
||||
if err := os.MkdirAll(dir, 0700); err != nil {
|
||||
t.Errorf("Failed to create temporary directory (%v)", err)
|
||||
}
|
||||
|
||||
if err := os.WriteFile(path.Join(dir, "go.mod"), goMod, 0600); err != nil { //nolint:mnd // This check is stupid
|
||||
if err := os.WriteFile(path.Join(dir, "go.mod"), goMod, 0600); err != nil {
|
||||
t.Errorf("%v", err)
|
||||
}
|
||||
if err := ejectFile("testmethod.go", path.Join(dir, "testmethod.go")); err != nil {
|
||||
@@ -65,7 +65,7 @@ func Python(t *testing.T) []string {
|
||||
|
||||
tempDir := t.TempDir()
|
||||
dir := path.Join(tempDir, "testmethod-py")
|
||||
if err := os.MkdirAll(dir, 0700); err != nil { //nolint:mnd // This check is stupid
|
||||
if err := os.MkdirAll(dir, 0700); err != nil {
|
||||
t.Errorf("Failed to create temporary directory (%v)", err)
|
||||
}
|
||||
target := path.Join(dir, "testmethod.py")
|
||||
@@ -81,7 +81,7 @@ func ejectFile(file string, target string) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to read %s file from embedded dataset (%w)", file, err)
|
||||
}
|
||||
if err := os.WriteFile(target, contents, 0600); err != nil { //nolint:mnd // This check is stupid
|
||||
if err := os.WriteFile(target, contents, 0600); err != nil {
|
||||
return fmt.Errorf("failed to create %s file at %s (%w)", file, target, err)
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user