* Lint the whole code base with JSCPD if VALIDATE_ALL_CODEBASE is true
* Use VALIDATE_JSCPD_ALL_CODEBASE
Co-authored-by: Lukas Gravley <admiralawkbar@github.com>
* fix(R linting): try installing the R package before linting R language
* the tool used to lint the R language gives false positives for files inside an R library, which is not installed
* this change tries to naively install the package in the linted directory
Resolves#1910
* fix code
* fixed it
* fixed it
Co-authored-by: Admiral Awkbar <admiralawkbar@github.com>
* Improve GITHUB_API_URL default value handling
GitHub Actions [already has](https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables) `GITHUB_API_URL` environment variable which contains GitHub API URL. We should be smart about overriding it and, if it exist and already has value, we should not override it.
* Strip slash from GITHUB_API_URL
* Update linter.sh
* Update linter.sh
* make shfmt happy
Co-authored-by: Lukas Gravley <admiralawkbar@github.com>
* Add support for google-java-format
* adding tests and array
* fix comma
* Update linter.sh
* get it in order
* fix hava version
Co-authored-by: Admiral Awkbar <admiralawkbar@github.com>
* Match AWS states file using "States" key
Matching only on `"Resource": "arn` is too wide and will match also aws json policy files
* Update detectFiles.sh
* spacing
Co-authored-by: Admiral Awkbar <admiralawkbar@github.com>
* Improve wording of LINTER_RULES_PATH docs (#1634).
* Add a template config file for ShellCheck (#1633).
Instruct ShellCheck to search SCRIPTDIR, the directory that the script
being linted is in, for other scripts that are sourced. Otherwise, the
commonly-used source command results in linter error SC1091. See
https://github.com/koalaman/shellcheck/wiki/SC1091 for more details.
* fix line ending
Co-authored-by: Lukas Gravley <admiralawkbar@github.com>
* 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>
* adding rules file
* fix naming
* cleanup
* make smart
* fixing the make
* adding template
* white space
* not sure how i got windows
* found the space
* adding new one...
* adding automation
* linter
* pull apart for faster builds
* maybe
* update automation
* fix that
* prime is smart
* fixed it
* quotes
* fix build image
* inpec
* typo
* forgot backslash
* fixed hairbrain logic
* this should help cleanup
* i hate r
* order
* maybe fix r
* maybe fix r
* update readme
* remove spaces
* update
* Allow ansible-lint with git diffs
super-linter checks the path of the file in lib/functions/detectFiles.sh to determine whether the file is an ansible playbook. When VALIDATE_ALL_CODEBASE=true, a list of absolute paths is generated which matches the expected path but when VALIDATE_ALL_CODEBASE=false, a list of relative paths is generated so no files are "detected" as ansible playbooks. This change outputs everything as an absolute path so diffs will also work.
* fix quotes
* Include eval to interpret pipe in cmd substitution
* more quotes
Co-authored-by: Admiral Awkbar <admiralawkbar@github.com>
* adding it
* fix typo
* fix tests
* adding back jsonlint
* adding back jsonlint
* fix spacing
* found the typo
* add tests
* adding rules for json
* add to local
* Bump alpine/terragrunt from 0.14.5 to 0.14.7
Bumps alpine/terragrunt from 0.14.5 to 0.14.7.
Signed-off-by: dependabot[bot] <support@github.com>
* set log level to error
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Admiral Awkbar <admiralawkbar@github.com>
Co-authored-by: Marco Ferrari <ferrari.marco@gmail.com>
* adding cert
* update readme
* typo
* make exec
* spaces
* adding better way
* adding example
* make shell happy
* fix space
* adding notes
* bad var
* duh
* Generate a code coverage report
* make linters happy
* adding action and badge
* no report for me
* Upload the test report
* adding folders
* spaces not tabs
* makefiles love tabs
* spacing is important
* rawr
* Fix makefile
* Add diagnostic info
* Set UID and GID
* Make info
* Add docker images in diagnostic info
* Move info before testing the local action
* Add missing -C to git diff-tree
* Reset ownership
* Add missing quotes
* Sudo
* Attempt to fix ARM test
* Attempt to fix go test
Co-authored-by: Admiral Awkbar <admiralawkbar@github.com>
* adding fun
* fix whitespace
* adding tests
* adding the array
* bug in file name
* fix tap
* makes no sense
* adding the hammer
* adding some extra protbuf
* Support custom rules with markdownlint
* Add MARKDOWN_CUSTOM_RULE_GLOBS to README.md
* Fix shellcheck issues and use bash array for globs
* Fix shfmt issues
Co-authored-by: Gabriel Diaz <gabo.fdc@gmail.com>
* Add debug info for multi status api calls
* Add test for clean action
* Add more verbose
* Test in action context
* Test use local build as action
* Improve debug for raw file array
* Fix shallow fetch
* Fix error messages on diff cmd
* Changed repeated code to function
* Fix quotes
* only error on lintr errors
* ensure that dockerfile includes purrr
* update tap snapshot
* add actual lint error
* add snapshot for actual error
Co-authored-by: Gabriel Diaz <gabo.fdc@gmail.com>
Co-authored-by: Lukas Gravley <admiralawkbar@github.com>
* Ignore files that are ignored by Git (#1185)
* Ignore files that are ignored by Git
* Add missing continue statement
* Fix linting errors
* Fix linting errors
* like it
* like it
* Add the IGNORE_GITIGNORED_FILES variable
* Fix setting the Ansible directory when running tests
* Fix var export
* Update linter.sh
Co-authored-by: Admiral Awkbar <admiralawkbar@github.com>
* Remove RenameTestFolder
* Update action.yml
* removing the dockignore from our test...
* fixed it
Co-authored-by: Marco Ferrari <ferrari.marco@gmail.com>
Co-authored-by: Admiral Awkbar <admiralawkbar@github.com>
* Ignore files that are ignored by Git
* Add missing continue statement
* Fix linting errors
* Fix linting errors
* like it
* like it
* Add the IGNORE_GITIGNORED_FILES variable
* Fix setting the Ansible directory when running tests
* Fix var export
* Update linter.sh
Co-authored-by: Admiral Awkbar <admiralawkbar@github.com>
* Update snakefmt to 0.3.0 and black to 20.3 (now suppored by snakefmt).
* Update pipfile for ansible 5.0
* Align pipfile python with Docker alpine image
* Explicitly pin python minor version in dockerfile
* Ansible updates
* Add missing cryptography dependencies
* Eliminate deprecated ansible syntax
* Update expected output for ansible
* Try to add regex to handle test run length
* Yaml doc syntax fixes
* Flailing attempt at tap wildcard
* Catch dynamic output from ansible-lint
* Update regex
* Fix regex statement
* Fix tap output
* Update go error message (issue from master branch)
* Fix regex
* Ansible strikes back
* Fix tap output
* Fix json tap
* Update r tap
* Move FILTER_REGEX_INCLUDE AND FILTER_REGEX_EXCLUDE before checking filetype
* missing continue, and a lint error
Co-authored-by: Marco Ferrari <ferrari.marco@gmail.com>
When lint fails, print command output on a newline surrounded by "------"
Co-authored-by: Lukas Gravley <admiralawkbar@github.com>
Co-authored-by: Gabriel Diaz <gabo.fdc@gmail.com>
* Improved ANSIBLE_DIRECTORY validation to support the repository root
Fixes#1110, which prevents linting playbooks at the root of the repository from being supported.
* Trim whitespace
* Remove undesired extra validation condition
Addressing review feedback from @ ferrarimarco
* Avoid mutating ANSIBLE_DIRECTORY beyond the extent that was already in place
Co-authored-by: Lukas Gravley <admiralawkbar@github.com>
* 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>
* updates to Terrascan v1.2.0
* updates command to explicitly scan terraform for all supported providers
* add no cache
* specify Pipfile
* verbose
* remove system
* remove cache
* put it back
* put it back
* clear
* adding cython
* more libs
* add system
Co-authored-by: Lukas Gravley <admiralawkbar@github.com>
Co-authored-by: SVN Migrator <someone@somewhere.com>
* Ignore node_modules and env folders
* Exclude media files
* Change env directory to separate dirs
* Remove env files
* Sort in alphabetical order
Co-authored-by: Lukas Gravley <admiralawkbar@github.com>
Since .editorconfig configuration files _could_ apply to any file, we
should pass in the RAW_FILE_ARRAY to it. This ensures that files of all
types are linted by editorconfig-checker.