Skip to main content
su6 checker

su6

6 is pronounced as '/zɛs/' in Dutch, so 'su6' is basically 'success'.
This package will hopefully help achieve that!

PyPI - Version PyPI - Python Version
Code style: black License: MIT
su6 checks Coverage

Table of Contents

Installation

# quick install with all possible checkers:
pip install su6[all]
# or pick and choose checkers:
pip install [black,bandit,pydocstyle]

Note: this package does not work well with pipx, since a lot of the tools need to be in the same (virtual) environment of your code, in order to do proper analysis.

The following checkers are supported:

ruff

  • install: pip install su6[ruff]
  • use: su6 ruff [directory]
  • functionality: linter
  • pypi: ruff

black

  • install: pip install su6[black]
  • use: su6 black [directory] [--fix]
  • functionality: formatter
  • pypi: black

mypy

  • install: pip install su6[mypy]
  • use: su6 mypy [directory]
  • functionality: static type checker
  • pypi: mypy

bandit

  • install: pip install su6[bandit]
  • use: su6 bandit [directory]
  • functionality: security linter
  • pypi: bandit

isort

  • install: pip install su6[isort]
  • use: su6 isort [directory] [--fix]
  • functionality: import sorter
  • pypi: isort

pydocstyle

  • install: pip install su6[pydocstyle]
  • use: su6 pydocstyle [directory]
  • functionality: docstring checker
  • pypi: pydocstyle

pytest

  • install: pip install su6[pytest]
  • use: su6 pytest [directory] [--coverage <int>] [--json] [--html] [--badge <path>]
  • functionality: tester with coverage
  • pypi: pytest, pytest-cov

Usage

su6 --help
# or, easiest to start:
su6 all
# usual signature:
su6 [--verbosity=1|2|3] [--config=...] [--format=text|json] <subcommand> [directory] [...specific options]

where subcommand is all or one of the available checkers;
verbosity indicates how much information you want to see (default is '2').
config allows you to select a different .toml file (default is pyproject.toml).
format allows you to get a JSON output instead of the textual traffic lights (default is text).
directory is the location you want to run the scans (default is current directory);
In the case of black and isort, another optional parameter --fix can be passed. This will allow the tools to do the suggested changes (if applicable). Running su6 fix will run both these tools with the --fix flag.
For pytest, --json, --html, --badge <str> and --coverage <int> are supported. The latter two can also be configured in the pyproject.toml (see 'Configuration'). The first two arguments can be used to control the output format of pytest --cov. Both options can be used at the same time. The --coverage flag can be used to set a threshold for code coverage %. If the coverage is less than this threshold, the check will fail. If badge is set using cli or toml config, a SVG badge with the coverage % will be generated. This badge can be used in for example the README.md.

Configuration

In your pyproject.toml, you can add a [tools.su6] section to configure some of the behavior of this tools. Currently, the following keys are supported:

[tool.su6]
directory = "." # string path to the directory on which to run all tools, e.g. 'src'
include = [] # list of checks to run (when calling `su6 all`), e.g. ['black', 'mypy']
exclude = [] # list of checks to skip (when calling `su6 all`), e.g. ['bandit']
stop-after-first-failure = false  # bool to indicate whether to exit 'all' after one failure or to do all checks
coverage = 100 # int threshold for pytest coverage 
badge = "coverage.svg"  # str path or bool (true | false) whether and where to output the coverage badge

All keys are optional. Note that if you have both an include as well as an exclude, all the tools in include will run and exclude will be fully ignored.
Additionally, the order in which the checks are defined in 'include', is the order in which they will run (in all and fix)

Github Action

In order to use this checker within Github to run checks after pushing, you can add a workflow (e.g. .github/workflows/su6.yaml) like this example:

name: run su6 checks
on:
  push:
    branches-ignore:
      - master
jobs:
  check:
    name: Check with `su6 all`
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: '3.11'
          cache: 'pip' # caching pip dependencies
      - run: pip install su6[all] .
      - run: su6 all

Note: if you don't want to run all checks, but specific ones only, you need to add the --ignore-uninstalled flag to su6 all! Otherwise, Github will see exit code 127 (command missing) as a failure.

name: run some su6 checks
on:
  push:
    branches-ignore:
      - master
jobs:
  check:
    name: Check with `su6 all`
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: '3.11'
          cache: 'pip' # caching pip dependencies
      - run: pip install su6[pycodestyle,black] .
      - run: su6 all --ignore-uninstalled  # ... other settings such as --stop-after-first-failure, --coverage ...

Plugins

This tool also supports plugins to add extra checkers or other functionality. See docs/plugins.md for information on how to build a Plugin.

svelte-check

robinvandernoord/su6-plugin-svelte-check is a Plugin that adds svelte-check functionality.
Can be installed using pip install su6[svelte-check]

prettier

robinvandernoord/su6-plugin-prettier is a Plugin that adds prettier.io functionality.
Can be installed using pip install su6[prettier]

License

su6 is distributed under the terms of the MIT license.

Changelog

See CHANGELOG.md on GitHub

Metadata

Release files for su6 1.10.1

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

Source distribution (sdist)

Source distribution for su6 1.10.1
File Size Uploaded
su6-1.10.1.tar.gz 166.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for su6 1.10.1
File Interpreter ABI Platform
su6-1.10.1-py3-none-any.whl Python 3 none any Details

Total release size: 188.3 kB

Release files / su6-1.10.1.tar.gz

Download URL su6-1.10.1.tar.gz
Size 166.7 kB
Tags Source
SHA-256 checksum
How to use checksums
096a72d42d99ae6f43117ae510b46a06f3b2d8477b4be13803e3e8dd7d7a05c9
BLAKE2b-256 checksum
How to use checksums
ff47f7acc2d687e554f8e41408d48c29592d4d8a88f66cc361502ef03d4aa29a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.7

Release files / su6-1.10.1-py3-none-any.whl

Download URL su6-1.10.1-py3-none-any.whl
Size 21.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
91e00ba6e3b0fa0b35b2aa02443b606926482c893ac9443a1c3f2b123b5144c3
BLAKE2b-256 checksum
How to use checksums
19d968c7167ffe51353a99e5d4671de4904e106de6f1a831a3d7e6e4f4574756
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.7

Release history Release notifications | RSS feed

This release

1.10.1 This release

2 release files

1.9.1

2 release files

1.9.0

2 release files

1.8.4

2 release files

1.8.3

2 release files

1.8.2

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.4

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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