Skip to content

Instantly share code, notes, and snippets.

@cantis
Last active October 27, 2025 03:28
Show Gist options
  • Save cantis/7d7f8a2097d5fd5772ed344a13909981 to your computer and use it in GitHub Desktop.
Save cantis/7d7f8a2097d5fd5772ed344a13909981 to your computer and use it in GitHub Desktop.
ruff.toml default config
#:schema = "https://json.schemastore.org/ruff.json"\
line-length = 120
# Bigger than the recomendation in pep 8 but they are focused on having multiple
# windows open side by side, which I rarely do (might matter for PR's?)
[lint]
select = ["E", "F", "I"]
# E = Pycodestyle errors
# F = Pyflakes rules (unused imports, unused-variables etc.)
# I = Import Sorting, missing imports
[format]
quote-style = "single"
# I use singles for regular strings, tripple double are still used for docstrings.
@cantis
Copy link
Author

cantis commented Aug 29, 2025

My Default ruff.toml for my projects.

Note: ruff.toml is the recommended file name and should be in the project root.

@cantis
Copy link
Author

cantis commented Oct 27, 2025

I've adjusted this now to be minimal, with the understanding that most of the default setup is fine and I just need to put in my custom items. The default line length is too short, and I want 'more' error checks and I prefer single quotes on regular strings. Note that this will leave the double quotes in place for docstrings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment