Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Statick Tooling Plugins

Unit Tests PyPI version Codecov Python Versions License Checked with mypy Daily Downloads Weekly Downloads Monthly Downloads

This is a set of plugins for Statick that will discover tooling related files and perform static analysis on those files.

Custom exceptions can be applied the same way they are with Statick exceptions.

Table of Contents

Deprecated

This set of plugins was merged into the main [Statick] repository and Python package. All future development will happen in that repository.

Installation

The recommended method to install these Statick plugins is via pip:

pip install statick-tooling

You can also clone the repository and use it locally.

Usage

Make sure you install all the dependencies from apt/npm. See https://github.com/nodesource/distributions for Node/npm installation instructions.

Configure npm to allow a non-root user to install packages.

npm config set prefix '~/.local/'

Make sure ~/.local/bin exists. Check your PATH with echo $PATH. If ~/.local/bin is not listed then add it to your PATH.

mkdir -p ~/.local/bin
echo 'export PATH="$HOME/.local/bin/:$PATH"' >> ~/.bashrc

Install npm packages.

npm install -g dockerfilelint
npm install -g dockerfile_lint

Pip Install

The most common usage is to use statick and statick-tooling from pip. In that case your directory structure will look like the following:

project-root
 |- tooling-project
 |- statick-config

To run with the default configuration for the statick-tooling tools use:

statick tooling-project/ --output-directory statick-output/ --profile tooling-profile.yaml

Pip Install and Custom Configuration

There are times when you will want to have a custom Statick configuration. This is usually done to run a different set of tools than are called out in the default profile, or to add exceptions. For this case you will have to add the new Statick configuration somewhere. This example will have custom exceptions in the tooling-project, such that the directory structure is:

project-root
 |- tooling-project
 |- statick-config
     |- rsc
         |- exceptions.yaml
 |- statick-output

For this setup you will run the following:

statick tooling-project/ --output-directory statick-output/ --user-paths tooling-project/statick-config/ --profile tooling-profile.yaml

Source Install and Custom Configuration

The last type of setup will be to have all of the tools available from cloning repositories, not installing from pip. The directory structure will look like:

project-root
 |- tooling-project
 |- statick-config
     |- rsc
         |- exceptions.yaml
 |- statick-output
 |- statick
 |- statick-tooling

Using the example where we want to override the default exceptions with custom ones in the tooling-project, the command to run would be:

./statick/statick tooling-project/ --output-directory statick-output/ --user-paths statick-tooling/,tooling-project/statick-config/ --profile tooling-profile.yaml

Existing Plugins

Discovery Plugins

Note that if a file exists without the extension listed it can still be discovered if the file command identifies it as a specific file type. This type of discovery must be supported by the discovery plugin and only works on operating systems where the file command exists.

File Type Extensions
dockerfile Dockerfile*

Tool Plugins

Tool About
dockerfilelint A rule based 'linter' for Dockerfiles.
dockerfile-lint A rule based 'linter' for Dockerfiles.
hadolint Dockerfile linter, validate inline bash, written in Haskell.

Contributing

If you write a new feature for Statick or are fixing a bug, you are strongly encouraged to add unit tests for your contribution. In particular, it is much easier to test whether a bug is fixed (and identify future regressions) if you can add a small unit test which replicates the bug.

Before submitting a change, please run tox to check that you have not introduced any regressions or violated any code style guidelines.

Mypy

Statick Tooling uses mypy to check that type hints are being followed properly. Type hints are described in PEP 484 and allow for static typing in Python. To determine if proper types are being used in Statick Tooling the following command will show any errors, and create several types of reports that can be viewed with a text editor or web browser.

python3 -m pip install mypy
mkdir report
mypy --ignore-missing-imports --strict --html-report report/ --txt-report report src

It is hoped that in the future we will generate coverage reports from mypy and use those to check for regressions.

Formatting

Statick code is formatted using black. To fix locally use

python3 -m pip install black
black src tests

Metadata

Release files for statick-tooling 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for statick-tooling 0.4.0
File Size Uploaded
statick_tooling-0.4.0.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for statick-tooling 0.4.0
File Interpreter ABI Platform
statick_tooling-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.0 kB

Release files / statick_tooling-0.4.0.tar.gz

Download URL statick_tooling-0.4.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c9089a0c33bdde64647d9f88f3baff69e3b0aff1c0c69b63d571e20745119a5c
BLAKE2b-256 checksum
How to use checksums
60f4799d81da800090d53657b6a11e2dfbe0335ae9bfd4dac2791b0b1daa11da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release files / statick_tooling-0.4.0-py3-none-any.whl

Download URL statick_tooling-0.4.0-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28444e8a9d4e0be7dd32e8a24506f44b8a6011f677eeb9a8daa39fd8993a290c
BLAKE2b-256 checksum
How to use checksums
c403393c61fd2f623e8330b7ff3e68fcf11e0a7b5d2ffd7015a27a17d541da2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page