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

@@ -1,20 +1,23 @@
---
name: Issue
about: Use this template for reporting a bug/issue.
title: "Issue: "
title: "Issue: <shortly describe issue>"
labels: kind/bug
assignees: ''
---
<!--
- Make sure you are able to reproduce it on the [latest version](https://github.com/nektos/act/releases)
- Search the existing issues.
- Refer to [README](https://github.com/nektos/act/blob/master/README.md).
- Make sure you are able to reproduce it on the [latest version](https://github.com/nektos/act/releases)
- Search the existing issues.
- Refer to [README](https://github.com/nektos/act/blob/master/README.md).
-->
## Act version
<!-- Paste output of `act --version` -->
<!--
- Paste output of `act --version` inside the code block below
- If you've built `act` yourself, please provide commit hash
-->
```none
@@ -22,14 +25,23 @@ assignees: ''
## Expected behaviour
<!-- Describe how whole process should go and finish -->
<!--
- Describe how whole process should go and finish
-->
## Actual behaviour
<!-- Describe what happened -->
<!--
- Describe the issue
-->
## Workflow and/or repository
<!--
- Provide workflow with which we can reproduce the issue
OR
- Provide link to your GitHub repository that contains the workflow
<details>
<summary>workflow</summary>
@@ -47,23 +59,23 @@ jobs:
## Steps to reproduce
<!--
Make sure to include command you used to run `act`
e.g.:
1. Clone example repo (https://github.com/cplee/github-actions-demo)
2. Enter cloned repo directory
3. Run `act -s SUPER_SECRET=im-a-value`
- Make sure to include full command with parameters you used to run `act`, example:
1. Clone example repo (https://github.com/cplee/github-actions-demo)
2. Enter cloned repo directory
3. Run `act -s SUPER_SECRET=im-a-value`
-->
## `act` output
<!-- Paste output from your terminal, use `-v` or `--verbose` for richer output -->
<!--
- Use `act` with `-v`/`--verbose` and paste output from your terminal in code block below
-->
<details>
<summary>Log</summary>
```none
PASTE YOUR LOG HERE
```
</details>

1
.github/linters/.golangci.yml vendored Symbolic link
View File

@@ -0,0 +1 @@
../../.golangci.yml

11
.github/linters/.markdown-lint.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
# Default state for all rules
default: true
# MD013/line-length - Line length
MD013: false
# MD033/no-inline-html - Inline HTML
MD033: false
# MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading
MD041: false

View File

@@ -7,6 +7,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v1
with:
go-version: 1.16
@@ -14,7 +16,19 @@ jobs:
env:
CGO_ENABLED: 0
with:
version: v1.32.2
version: v1.39.0
- uses: github/super-linter@v3
env:
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER_REGEX_EXCLUDE: .*testdata/*
VALIDATE_ALL_CODEBASE: ${{ github.event_name != 'pull_request' }} # lint only new changes when pull_request
VALIDATE_BASH: false
VALIDATE_DOCKERFILE: false
VALIDATE_DOCKERFILE_HADOLINT: false
VALIDATE_GO: false # it's broken, see commit message
VALIDATE_JSCPD: false
VALIDATE_SHELL_SHFMT: false
test:
name: Test on Linux