Add super-linter + fix lint issues (#650)

* feat: bump `golangci-lint`, add `super-linter`, replace outdated linter

Bump `golangci-lint` version.
Add `super-linter` to lint other languages.
Go linter is disabled because it's currently broken:
https://github.com/github/super-linter/pull/370
Replacing `scopelint` with `exportloopref`: "[runner] The linter
'scopelint' is deprecated (since v1.39.0) due to: The repository of the
linter has been deprecated by the owner.  Replaced by exportloopref."
Fixed formatting in `.golangci.yml`
Add addtional linters:
  `misspell`: purely style, detects typos in comments
  `whitespace`: detects leading and trailing whitespace
  `goimports`: it's gofmt + checks unused imports

* fix: lint/fix `go` files

* fix: lint with `standardjs`

* fix: lint/fix with `markdownlint`, make template more verbose

* feat: add lint stuff to makefile

* fix: `UseGitIgnore` formatting

* fix: lint/fix `README.md`

Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
Ryan (hackercat)
2021-05-03 18:52:03 +02:00
committed by GitHub
parent 3db3d416e3
commit cec63488f3
24 changed files with 141 additions and 69 deletions

View File

@@ -28,7 +28,6 @@ func CopyFile(source string, dest string) (err error) {
if err != nil {
_ = os.Chmod(dest, sourceinfo.Mode())
}
}
return
@@ -36,7 +35,6 @@ func CopyFile(source string, dest string) (err error) {
// CopyDir recursive copy of directory
func CopyDir(source string, dest string) (err error) {
// get properties of source dir
sourceinfo, err := os.Stat(source)
if err != nil {
@@ -55,7 +53,6 @@ func CopyDir(source string, dest string) (err error) {
objects, err := directory.Readdir(-1)
for _, obj := range objects {
sourcefilepointer := source + "/" + obj.Name()
destinationfilepointer := dest + "/" + obj.Name()
@@ -73,7 +70,6 @@ func CopyDir(source string, dest string) (err error) {
fmt.Println(err)
}
}
}
return err
}

View File

@@ -301,7 +301,6 @@ func NewGitCloneExecutor(input NewGitCloneExecutorInput) Executor {
// Repos on disk point to commit hashes, and need to checkout input.Ref before
// we try and pull down any changes
if hash.String() != input.Ref {
// Run git fetch to make sure we have the latest sha
err := r.Fetch(&git.FetchOptions{})
if err != nil && !errors.Is(err, git.NoErrAlreadyUpToDate) {

View File

@@ -40,7 +40,6 @@ func TestFindGitSlug(t *testing.T) {
assert.Equal(tt.provider, provider)
assert.Equal(tt.slug, slug)
}
}
func testDir(t *testing.T) string {