Skip to content

Commit

Permalink
Merge pull request #101 from 23andMe/upgrading-superlinter-with-remote
Browse files Browse the repository at this point in the history
Upgrading superlinter with remote
  • Loading branch information
nandusekarv10 authored Jun 21, 2021
2 parents 992dfe3 + 53e7d36 commit ab621f2
Show file tree
Hide file tree
Showing 17 changed files with 2,167 additions and 148 deletions.
17 changes: 17 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 14
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
4 changes: 2 additions & 2 deletions .github/workflows/deploy-PROD-slim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
# Update deployment API #
#########################
- name: Start deployment
uses: bobheadxi/deployments@v0.5.2
uses: bobheadxi/deployments@v0.6.0
id: deployment
with:
step: start
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
# Update Deployment API #
#########################
- name: Update deployment status
uses: bobheadxi/deployments@v0.5.2
uses: bobheadxi/deployments@v0.6.0
if: always()
with:
step: finish
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-PROD-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
# Update deployment API #
#########################
- name: Start deployment
uses: bobheadxi/deployments@v0.5.2
uses: bobheadxi/deployments@v0.6.0
id: deployment
with:
step: start
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
# Update Deployment API #
#########################
- name: Update deployment status
uses: bobheadxi/deployments@v0.5.2
uses: bobheadxi/deployments@v0.6.0
if: always()
with:
step: finish
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-RELEASE-slim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
# Update deployment API #
#########################
- name: Start deployment
uses: bobheadxi/deployments@v0.5.2
uses: bobheadxi/deployments@v0.6.0
id: deployment
with:
step: start
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
# Update Deployment API #
#########################
- name: Update deployment status
uses: bobheadxi/deployments@v0.5.2
uses: bobheadxi/deployments@v0.6.0
if: always()
with:
step: finish
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-RELEASE-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
# Update deployment API #
#########################
- name: Start deployment
uses: bobheadxi/deployments@v0.5.2
uses: bobheadxi/deployments@v0.6.0
id: deployment
with:
step: start
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
# Update Deployment API #
#########################
- name: Update deployment status
uses: bobheadxi/deployments@v0.5.2
uses: bobheadxi/deployments@v0.6.0
if: always()
with:
step: finish
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
#########################################
# Get dependency images as build stages #
#########################################
FROM cljkondo/clj-kondo:2021.04.23-alpine as clj-kondo
FROM dotenvlinter/dotenv-linter:3.0.0 as dotenv-linter
FROM cljkondo/clj-kondo:2021.06.01-alpine as clj-kondo
FROM dotenvlinter/dotenv-linter:3.1.0 as dotenv-linter
FROM mstruebing/editorconfig-checker:2.3.5 as editorconfig-checker
FROM yoheimuta/protolint:v0.32.0 as protolint
FROM golangci/golangci-lint:v1.40.1 as golangci-lint
FROM koalaman/shellcheck:v0.7.2 as shellcheck
FROM wata727/tflint:0.29.0 as tflint
FROM alpine/terragrunt:0.15.5 as terragrunt
FROM wata727/tflint:0.29.1 as tflint
FROM alpine/terragrunt:1.0.0 as terragrunt
FROM mvdan/shfmt:v3.3.0 as shfmt
FROM accurics/terrascan:1.6.0 as terrascan
FROM accurics/terrascan:1.7.0 as terrascan
FROM hadolint/hadolint:latest-alpine as dockerfile-lint
FROM assignuser/chktex-alpine:v0.1.1 as chktex
FROM garethr/kubeval:0.15.0 as kubeval
Expand Down Expand Up @@ -297,7 +297,7 @@ RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community/" >> /etc/apk/repo
# Grab small clean image #######################################################
################################################################################
FROM ghcr.io/assignuser/lintr-lib:0.2.0 as lintr-lib
FROM alpine:3.13.5 as final
FROM alpine:3.14.0 as final

############################
# Get the build arguements #
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile-slim
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
#########################################
# Get dependency images as build stages #
#########################################
FROM cljkondo/clj-kondo:2021.04.23-alpine as clj-kondo
FROM cljkondo/clj-kondo:2021.06.01-alpine as clj-kondo
FROM mstruebing/editorconfig-checker:2.3.5 as editorconfig-checker
FROM yoheimuta/protolint:v0.32.0 as protolint
FROM golangci/golangci-lint:v1.40.0 as golangci-lint
FROM koalaman/shellcheck:v0.7.2 as shellcheck
FROM wata727/tflint:0.29.0 as tflint
FROM alpine/terragrunt:0.15.5 as terragrunt
FROM wata727/tflint:0.29.1 as tflint
FROM alpine/terragrunt:1.0.0 as terragrunt
FROM mvdan/shfmt:v3.3.0 as shfmt
FROM accurics/terrascan:1.6.0 as terrascan
FROM accurics/terrascan:1.7.0 as terrascan
FROM hadolint/hadolint:latest-alpine as dockerfile-lint
FROM assignuser/chktex-alpine:v0.1.1 as chktex
FROM garethr/kubeval:0.15.0 as kubeval
Expand Down Expand Up @@ -229,7 +229,7 @@ RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community/" >> /etc/apk/repo
# Grab small clean image #######################################################
################################################################################
FROM ghcr.io/assignuser/lintr-lib:0.2.0 as lintr-lib
FROM alpine:3.13.5 as final
FROM alpine:3.14.0 as final

############################
# Get the build arguements #
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ endif

.PHONY: inspec
inspec: inspec-check ## Run InSpec tests
LOCAL_IMAGE="$$(docker images $(SUPER_LINTER_TEST_CONTINER_URL) |grep 'ghcr.io/github/super-linter')"; \
if [ "$$?" -ne 0 ]; then docker build -t $(SUPER_LINTER_TEST_CONTINER_URL) -f Dockerfile .; fi && \
DOCKER_CONTAINER_STATE="$$(docker inspect --format "{{.State.Running}}" "$(SUPER_LINTER_TEST_CONTAINER_NAME)" 2>/dev/null || echo "")"; \
if [ "$$DOCKER_CONTAINER_STATE" = "true" ]; then docker kill "$(SUPER_LINTER_TEST_CONTAINER_NAME)"; fi && \
docker build -t $(SUPER_LINTER_TEST_CONTAINER_NAME) -f $(DOCKERFILE) . && \
docker tag $(SUPER_LINTER_TEST_CONTINER_URL) $(SUPER_LINTER_TEST_CONTAINER_NAME) && \
SUPER_LINTER_TEST_CONTAINER_ID="$$(docker run -d --name "$(SUPER_LINTER_TEST_CONTAINER_NAME)" --rm -it --entrypoint /bin/ash "$(SUPER_LINTER_TEST_CONTAINER_NAME)" -c "while true; do sleep 1; done")" \
&& docker run $(DOCKER_FLAGS) \
--rm \
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ The available images:

The standard `github/super-linter:v4` comes with all supported linters.
Example usage:

```yml
################################
# Run Linter against code base #
Expand All @@ -237,14 +238,17 @@ Example usage:
#### Slim Image
The slim `github/super-linter:slim-v4` comes with all supported linters but removes the following:

- `rust` linters
- `dotenv` linters
- `armttk` linters
- `pwsh` linters
- `c#` linters

By removing these linters, we were able to bring the image size down by `2gb` and drastically speed up the build and download time.
The behavior will be the same for non-supported languages, and will skip languages at run time.
Example usage:

```yml
################################
# Run Linter against code base #
Expand Down Expand Up @@ -298,6 +302,7 @@ But if you wish to select or exclude specific linters, we give you full control
| **MULTI_STATUS** | `true` | A status API is made for each language that is linted to make visual parsing easier. |
| **MARKDOWN_CONFIG_FILE** | `.markdown-lint.yml` | Filename for [Markdownlint configuration](https://github.com/DavidAnson/markdownlint#optionsconfig) (ex: `.markdown-lint.yml`, `.markdownlint.json`, `.markdownlint.yaml`) |
| **MARKDOWN_CUSTOM_RULE_GLOBS** | `.markdown-lint/rules,rules/**` | Comma-separated list of [file globs](https://github.com/igorshubovych/markdownlint-cli#globbing) matching [custom Markdownlint rule files](https://github.com/DavidAnson/markdownlint/blob/main/doc/CustomRules.md). |
| **PHP_CONFIG_FILE** | `php.ini` | Filename for [PHP Configuration](https://www.php.net/manual/en/configuration.file.php) (ex: `php.ini`) |
| **PYTHON_BLACK_CONFIG_FILE** | `.python-black` | Filename for [black configuration](https://github.com/psf/black/blob/master/docs/compatible_configs.md) (ex: `.isort.cfg`, `pyproject.toml`) |
| **PYTHON_FLAKE8_CONFIG_FILE** | `.flake8` | Filename for [flake8 configuration](https://flake8.pycqa.org/en/latest/user/configuration.html) (ex: `.flake8`, `tox.ini`) |
| **PYTHON_ISORT_CONFIG_FILE** | `.isort.cfg` | Filename for [isort configuration](https://pycqa.github.io/isort/docs/configuration/config_files/) (ex: `.isort.cfg`, `pyproject.toml`) |
Expand All @@ -309,6 +314,7 @@ But if you wish to select or exclude specific linters, we give you full control
| **SSL_CERT_SECRET** | `none` | SSL cert to add to the **Super-Linter** trust store. This is needed for users on `self-hosted` runners or need to inject the cert for security standards (ex. ${{ secrets.SSL_CERT }}) |
| **SQL_CONFIG_FILE** | `.sql-config.json` | Filename for [SQL-Lint configuration](https://sql-lint.readthedocs.io/en/latest/files/configuration.html) (ex: `sql-config.json` , `.config.json`) |
| **TYPESCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [eslint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`) |
| **USE_FIND_ALGORITHM** | `false` | By default, we use `git diff` to find all files in the workspace and what has been updated, this would enable the Linux `find` method instead to find all files to lint |
| **VALIDATE_ALL_CODEBASE** | `true` | Will parse the entire repository and find all files to validate across all types. **NOTE:** When set to `false`, only **new** or **edited** files will be parsed for validation. |
| **VALIDATE_ANSIBLE** | `true` | Flag to enable or disable the linting process of the Ansible language. |
| **VALIDATE_ARM** | `true` | Flag to enable or disable the linting process of the ARM language. |
Expand Down Expand Up @@ -446,7 +452,9 @@ We will also support [GitHub Codespaces](https://github.com/features/codespaces/
If you need to inject a SSL cert into the trust store, you will need to first copy the cert to **GitHub Secrets**
Once you have copied the plain text certificate into **GitHub Secrets**, you can use the variable `SSL_CERT_SECRET` to point the **Super-Linter** to the files contents.
Once found, it will load the certificate contents to a file, and to the trust store.

- Example workflow:

```yml
- name: Lint Code Base
uses: github/super-linter@v4
Expand All @@ -457,7 +465,7 @@ Once found, it will load the certificate contents to a file, and to the trust st

## Community Activity

<img src="https://cauldron.io/project/2083/stats.svg" >
![super-linter stats](https://cauldron.io/project/2083/stats.svg)

## Limitations

Expand Down
Loading

0 comments on commit ab621f2

Please sign in to comment.