Lint everything From A to Z
50K+
Lint everything From A to Z
Project links:
| Platform | Latest version |
|---|---|
| GitHub | |
| DockerHub |
The main purpose of AZLint is to bundle as many linters as possible into a single docker image and provide convenient CLI interface for calling them in bulk.
I see it as a complement to SuperLinterβ and MegaLinterβ . These meta-linters are awesome, but are missing some features of AZLint.
All that said, AZLint is mostly for my personal usage. However feel free to use it and report any found issues π.
x64/arm64 available)
NOTE: In this chapter, we will use :latest tag.
It is recommended to replace :latest with a specific version when you use it.
Go to dockerhub's tagsβ to see all available tags or go to github's releasesβ for all project versions.
To lint files in current directory:
docker run -itv "$PWD:/project:ro" matejkosiarcik/azlint:latest lint
To format files in current directory:
docker run -itv "$PWD:/project" matejkosiarcik/azlint:latest fmt
When in doubt, print help:
$ docker run matejkosiarcik/azlint:latest --help
Usage: azlint <command> [optionsβ¦] [dir]
Commands:
azlint lint Lint project (default)
azlint fmt Format project (autofix)
Positionals:
dir Path to project directory [string] [default: "."]
Options:
-h, --help Show usage [boolean]
-V, --version Show version [boolean]
-v, --verbose Verbose logging (stackable, max: -vvv) [count]
-q, --quiet Less logging [boolean]
--only-changed Analyze only changed files (requires project to be a git directory) [boolean]
-n, --dry-run Dry run [boolean]
--color Colored output [string] [choices: "auto", "never", "always"] [default: "auto"]
Refer to Linux & macOS examples above, just swap $PWD to %cd%, for example:
docker run -itv "%cd%:/project:ro" matejkosiarcik/azlint:latest lint
azlint:
image: matejkosiarcik/azlint:latest
script:
- lint
version: 2.1
workflows:
version: 2
workflow:
jobs:
- azlint
jobs:
azlint:
docker:
- image: matejkosiarcik/azlint:latest
steps:
- checkout
- run: lint
name: AZLint
permissions: read-all
on:
push:
branches:
- main
pull_request:
jobs:
azlint:
name: AZLint
runs-on: ubuntu-latest
container:
image: matejkosiarcik/azlint:latest
options: --user root
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Full git history is needed to get a proper list of changed files
- name: Run AZLint
run: lint
AZLint is configured by environment variables with AZLINT_ prefix.
AZLint looks for config files in following places by default: [git-root]/ and [git-root]/.config/.
You can specify a custom config directory with: AZLINT_CONFIG_DIR=some/config/directory
(note: path value is relative to [git-root]).
AZLint will find config files and pass them to linters automatically.
If you want to specify a custom config file for a specific linter, set AZLINT_FOO_CONFIG_FILE=some/path/file.json
(note 1: replace FOO with specific linter's name;
note 2: file path is relative to specified config directory).
You can turn of linters/formatters by specifying environment variable AZLINT_FOO=false
(note: replace FOO with specific linter's name).
A note about linter names, if a linter is named foo-bar,
then you need to specify environment variable named FOO_BAR
(so capitalized and underscores instead of dashes).
| tool | links | disable | files | fmt support |
|---|---|---|---|---|
| editorconfig-checker | GitHubβ docsβ | VALIDATE_EDITORCONFIG_CHECKER | * | β |
| eclint | GitHubβ | VALIDATE_ECLINT | * | β |
| Git check-ignore [custom] | - | VALIDATE_GITIGNORE | * | β |
| jscpd | GitHubβ | VALIDATE_JSCPD | * | β |
| tool | links | disable | files | fmt support |
|---|---|---|---|---|
| dotenv-linter | GitHubβ docsβ | VALIDATE_DOTENV | *.env | β |
| jsonlint | GitHubβ try-onlineβ | VALIDATE_JSONLINT | *.json | β* |
| prettier | GitHubβ docsβ | VALIDATE_PRETTIER | *.{json,yml,css,html} | β |
| stoml | GitHubβ | VALIDATE_STOML | *.{cfg,ini,toml} | β |
| tomljson (go-toml) | GitHubβ | VALIDATE_TOMLJSON | *.toml | β |
| yamllint | GitHubβ docsβ | VALIDATE_YAMLLINT | *.{yml,yaml} | β |
Jsonlint* - Formatting conflicts with prettier, so it is turned off.
These tools are not real "linters".
These tools are vanilla package managers, which we invoke with a dry-run flag to only attempt to install dependencies without actually installing them.
This verifies the given config files are actually working in that respective package manager.
| tool | links | disable | files | fmt support |
|---|---|---|---|---|
| brew-bundle | GitHubβ manpageβ | VALIDATE_BREW_BUNDLE | Brewfile | β |
| composer-install | docsβ | VALIDATE_COMPOSER_INSTALL | composer.json | β |
| pip-install | docsβ | VALIDATE_PIP_INSTALL | requirements.txt | β |
| npm-install | docsβ | VALIDATE_NPM_INSTALL | package.json | β |
| npm-ci | docsβ | VALIDATE_NPM_CI | package.json & package-lock.json | β |
Extra validators for package-manager files. These check additional rules, which are recommended, but not required for the config files to be valid.
| tool | links | disable | files | fmt support |
|---|---|---|---|---|
| composer-normalize | GitHubβ blogpostβ | VALIDATE_COMPOSER_NORMALIZE | composer.json | β |
| composer-validate | docsβ | VALIDATE_COMPOSER_VALIDATE | composer.json | β |
| package-json-validator | GitHubβ | VALIDATE_PACKAGE_JSON | package.json | β |
| tool | links | disable | files | fmt support |
|---|---|---|---|---|
| CircleCI CLI lint | docsβ GitHubβ | VALIDATE_CIRCLECI_VALIDATE | .circleci/config.yml | β |
| gitlab-ci-lint | GitHubβ | VALIDATE_GITLABCI_LINT | .gitlab-ci.yml | β |
| gitlab-ci-validate | GitHubβ | VALIDATE_GITLABCI_VALIDATE | .gitlab-ci.yml | β |
| tool | links | disable | files | fmt support |
|---|---|---|---|---|
| checkmake | GitHubβ | VALIDATE_CHECKMAKE | Makefile etc. | β |
| BSD Make | manpageβ | VALIDATE_BMAKE | Makefile etc. | β |
| GNU Make | docsβ manpageβ | VALIDATE_GMAKE | Makefile etc. | β |
| tool | links | disable | files | fmt support |
|---|---|---|---|---|
| dockerfilelint | GitHubβ try-onlineβ | VALIDATE_DOCKERFILELINT | Dockerfile etc. | β |
| hadolint | GitHubβ | VALIDATE_HADOLINT | Dockerfile etc. | β |
| tool | links | disable | files | fmt support |
|---|---|---|---|---|
| HTMLHint | GitHubβ | VALIDATE_HTMLHINT | *.{html,htm} | β |
| htmllint | GitHubβ | VALIDATE_HTMLLINT | *.{html,htm} | β |
| SVGLint | GitHubβ | VALIDATE_SVGLINT | *.svg | β |
| xmllint | gitlabβ docsβ manpageβ | VALIDATE_XMLLINT | *.xml | β |
| tool | links | disable | files | fmt support |
|---|---|---|---|---|
| markdown-link-check | GitHubβ | VALIDATE_MARKDOWN_LINK_CHECK | *.md | β |
| markdownlint | GitHubβ | VALIDATE_MARKDOWNLINT | *.md | β |
| markdownlint (mdl) | GitHubβ | VALIDATE_MDL | *.md | β |
| proselint | GitHubβ | VALIDATE_PROSELINT | *.{md,txt} | β |
| tool | links | disable | files | fmt support |
|---|---|---|---|---|
| bashate | GitHubβ opendevβ docsβ | VALIDATE_BASHATE | *.sh etc. | β |
| bats-core | GitHubβ docsβ | VALIDATE_BATS | *.bats | β |
| shellcheck | GitHubβ wikiβ try-onlineβ | VALIDATE_SHELLCHECK | *.sh etc. | β |
| shellharden | GitHubβ | VALIDATE_SHELLHARDEN | *.sh etc. | β |
| shfmt | GitHubβ go pkgβ | VALIDATE_SHFMT | *.sh etc. | β |
| hush | GitHubβ docsβ | VALIDATE_HUSH | *.hush | β |
| Custom dry runner | - | VALIDATE_SHELL_DRY_RUN | *.sh etc. | β |
The following shells are checked in custom dry runner:
| tool | links | linter ID | files | fmt support |
|---|---|---|---|---|
| Linux port of OpenBSD's ksh (loksh) | GitHubβ | LOKSH - loksh | *.{sh,ksh} | β |
| Portable OpenBSD ksh (oksh) | GitHubβ | OKSH - oksh | *.{sh,ksh} | β |
| tool | links | disable | files | fmt support |
|---|---|---|---|---|
| autopep8 | GitHubβ pypiβ | VALIDATE_AUTOPEP8 | *.py | β* |
| black | GitHubβ docsβ pypiβ | VALIDATE_BLACK | *.py | β |
| flake8 | GitHubβ docsβ pypiβ | VALIDATE_FLAKE8 | *.py | β |
| isort | GitHubβ docsβ pypiβ | VALIDATE_ISORT | *.py | β |
| pycodestyle | GitHubβ docsβ pypiβ | VALIDATE_PYCODESTYLE | *.py | β |
| pylint | GitHubβ docsβ pypiβ | VALIDATE_PYLINT | *.py | β |
| mypy | GitHubβ docsβ pypiβ | VALIDATE_MYPY | *.py | β |
Autopep8* - Formatting conflicts with black, so it is turned off.
In order to develop on this project, first install required system packages.
brew bundle install in project's root directory.
This will install all packages from Brewfile (learn more about Homebrew Bundleβ )..circleci/config.yml -> job native-build for apt-get instructions.Note: Also make sure you have Docker installed.
Now run make bootstrap to install local project dependencies.
To run project locally:
npm run azlint:fmt && npm run azlint:lint
To build and run project in docker:
make build run
This project is licensed under the MIT License, see LICENSE.txtβ for full license details.
Content type
Image
Digest
sha256:9cb4c184dβ¦
Size
421.2 MB
Last updated
almost 2 years ago
docker pull matejkosiarcik/azlint