A container for running lint against Dockerfile, python, scss, and javascript.
⮕ See https://github.com/divio/lint
Running it in bash:
alias lint="docker run --rm -it --env-file=.lint -v $(pwd):/app divio/lint /bin/lint"
lint
lint --check
lint --run=js,python
The content of the .lint file should be relative paths to source files. The linters will be executed in the /app working directory, but with --staged, they operate on files in a
temporary directory instead (this option includes --check as it operates on temporary copies).
Example of .lint:
LINT_FILE_DOCKER=Dockerfile
LINT_FOLDER_PYTHON=src
LINT_FOLDER_SCSS=private/sass/**/*.scss
LINT_FOLDER_JS=static/js/**/*.js
If one of the above environment variable is not set, the linter for this language will be skipped.
The following options are available for the /bin/lint script:
-c / --check: only check compliance, do not automatically fix errors--staged: only run against files staged for commit, useful for pre-commit hooks. Note that it implies --check.--run: only run a subset of linters. --run=all is equivalent to --run=python,js,docker,scss.The following linters are available:
docker: runs hadolintpython: runs ruff (for both linting and formatting)scss: runs prettierjs: runs prettierEach tool is configured with sensible defaults adopted at Divio.
IMPORTANT: to configure ruff with the defaults, add the following to your pyproject.toml:
[tool.ruff]
extend = "/presets/ruff.toml"
Content type
Image
Digest
sha256:826176fc2…
Size
46.5 MB
Last updated
4 months ago
docker pull divio/lint