Commit graph

9 commits

Author SHA1 Message Date
Lukas Gravley
c649496209
suppress warn messages (#1943) 2021-09-07 10:12:49 -05:00
Xiao Liang
f6910e3ee9
feat: support bats (#1778)
Support linting of bats files by identifying them as shell scripts (they actually are)
2021-07-19 09:30:44 -05:00
Lukas Gravley
ab24b82199
Adding actionlint (#1775)
* Adding action lint

* adding tests

* adding tests

* Update Dockerfile

Co-authored-by: Masaya Suzuki <15100604+massongit@users.noreply.github.com>

* cleanup name

* fix test

* typo

* fix file name

* fix our own errors

* more cleanup

* angry

* make it happy

* stop double jobs

Co-authored-by: Masaya Suzuki <15100604+massongit@users.noreply.github.com>
2021-07-19 09:28:49 -05:00
Stepan Koltsov
e059100991
Ignore files marked with @generated marker (#1689)
* Ignore files marked with @generated marker

`@generated` marker is used by certain tools to understand that the
file is generated, so it should be treated differently than a file
written by a human:
* these files do not need to be reformatted,
* diffs in these files are less important,
* and linters should not be invoked on these files.

This PR proposes builtin support for `@generated` marker (and
`@not-generated` marker to mark file as not generated when it
contains `@generated` marker, like `README.md`).

I have not found a standard for a generated file marker, but:
* Facebook [uses `@generated` marker](https://tinyurl.com/fb-generated)
* Phabricator tool which was spawned from Facebook internal tool
  [also understands `@generated` marker](https://git.io/JnVHa)
* Cargo inserts `@generated` marker into [generated Cargo.lock files](https://git.io/JnVHP)

Super-linter supports regex includes and excludes, but they are
harder to maintain (each repository needs to be configured) than
patching the tools which generate the files.

My personal story is that I maintain rust-protobuf crate, which
started emitting `@generated` markers [six years ago](https://git.io/JnV5h)
after a request of a Phabricator user.

Test Plan:

Create a test file `test.sh`:

```
echo $a
```

Run:

```
docker run -e RUN_LOCAL=true -v $HOME/tmp/g:/tmp/lint super-linter-test
```

Result is:

```
In /tmp/lint/test.sh line 1:
echo $a
^-- SC2148: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
     ^-- SC2154: a is referenced but not assigned.
     ^-- SC2086: Double quote to prevent globbing and word splitting.
...
2021-06-22 23:46:16 [ERROR]   ERRORS FOUND in BASH:[1]
```

Now add `@generated` to the file and run again:

```
2021-06-22 23:47:13 [NOTICE]   All file(s) linted successfully with no errors detected
```

Additionally, add `@not-generated` in addition to `@generated`, and
linter error pops up again.

* cleanup

* remove space

* fix non utf return

* fix non utf return

Co-authored-by: Lukas Gravley <admiralawkbar@github.com>
2021-06-28 07:59:11 -05:00
Lukas Gravley
ebf6194d0e
wildcard search (#1608) 2021-06-01 12:17:13 -05:00
Marco Ferrari
ab8780a58f
Install, configure, and run jscpd. Add missing tests (#1032)
Co-authored-by: Gabo <gabo.fdc@gmail.com>
Co-authored-by: Matt Desmond <beardofedu@github.com>
Co-authored-by: Lukas Gravley <admiralawkbar@github.com>
2021-01-27 20:47:34 +01:00
Marco Ferrari
156024e231
Simplify linter and worker by generalizing ansible-lint (#1035)
Co-authored-by: Lukas Gravley <admiralawkbar@github.com>
2020-12-04 16:04:09 -06:00
Gabriel Diaz
cf0e6a9704
Change log level from warn to debug (#1034)
* Change log level from warn to debug

* Move 'Linting x file' to be printed only if files are found

Co-authored-by: Lukas Gravley <admiralawkbar@github.com>
2020-11-30 11:19:17 -06:00
Lukas Gravley
7943ce1f54
break out: (#990)
* break out:

* fix it

* fix source

* add them exports

* more path

* more path
2020-11-12 11:27:34 -06:00