https://github.com/nickineering/ruff-config
A shareable Ruff starting config designed to get as much as possibly from Ruff quickly.
https://github.com/nickineering/ruff-config
dotfiles linting python ruff
Last synced: 4 months ago
JSON representation
A shareable Ruff starting config designed to get as much as possibly from Ruff quickly.
- Host: GitHub
- URL: https://github.com/nickineering/ruff-config
- Owner: nickineering
- License: mit
- Created: 2024-03-26T18:05:44.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-22T00:27:37.000Z (over 1 year ago)
- Last Synced: 2025-06-12T20:04:41.751Z (about 1 year ago)
- Topics: dotfiles, linting, python, ruff
- Language: Python
- Homepage: https://pypi.org/project/nickineering-ruff-config/
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nickineering's Default Ruff Config

A shareable Ruff starting config designed to get as much as possibly from Ruff
quickly.
## Usage
```bash
pip install ruff nickineering-ruff-config
```
Pip install this package, [Ruff](https://docs.astral.sh/ruff/), and create a
`ruff.toml` or another Ruff supported configuration file in your project root.
Inside that file extend this config like so:
```toml
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:
```toml
[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.
Finally, add the output to your `.gitignore` so you can rely only on the
package.
```gitignore
# Automatically updated configuration file from nickineering-ruff-config
nickineering-ruff-base.toml
```
It is also recommended to create a `Makefile` or other command runner to
document that the update-ruff-base command must be run when installing the
project and so that calls to Ruff run both the lint and format commands. An
example `Makefile` is below:
```makefile
setup:
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.