Skip to main content

A shareable Ruff starting config designed to get as much as possibly from Ruff quickly.

Project description

Nickineering's Default Ruff Config

PyPI - Version

A shareable Ruff starting config designed to get as much as possibly from Ruff quickly.

Usage

Install Ruff and create a ruff.toml or another Ruff supported configuration file in your project root. Inside that file extend this config like so:

extend = "nickineering-ruff-base.toml"

# Override these settings, or add your own here

# For example:
[format]
docstring-code-format = false

You will also need to create a script to copy the file, since Ruff does not support extending from a package. This is a Poetry script which does that as an example:

[tool.poetry.scripts]
update-ruff-base = "nickineering_ruff_config:update_ruff_base"

You could then run it with poetry run update-ruff-base. This would need to be re-run to install new versions of this package.

You probably want to add the output to your .gitignore so you can rely only on the package. To do so add the following: nickineering-ruff-base.toml.

Although it is not required, I recommend creating a Makefile or other command runner so that calls to Ruff run both the lint and format commands. An example Makefile is below:

configure:
    poetry install
    poetry run update-ruff-base

lint:
    ruff format
    ruff check --fix

Publishing

A Github Action is automatically run deploying this code to PyPi when a new release is published in Github.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nickineering_ruff_config-0.2.0.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

nickineering_ruff_config-0.2.0-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page