Skip to content

Lint: Create a project-wide .ruff.toml settings file #133124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 1, 2025

Conversation

AA-Turner
Copy link
Member

@AA-Turner AA-Turner commented Apr 29, 2025

We have some settings that are replicated in every .ruff.toml. It's somewhat useful to centralise, so that we keep consistency throughout the project.

I've set target-version as 3.10 as that seems most common (inspired by PYTHON_FOR_REGEN?), but I'd have no objections to requiring something more recent.

I believe we need the extend lines, unless there's some way to get Ruff to automatically look in parent/project root directories (cc @AlexWaygood).

A


📚 Documentation preview 📚: https://cpython-previews--133124.org.readthedocs.build/

@AlexWaygood
Copy link
Member

I believe we need the extend lines, unless there's some way to get Ruff to automatically look in parent/project root directories (cc @AlexWaygood).

yup, that's the correct way to do config-file inheritance!

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you!

AA-Turner and others added 2 commits May 1, 2025 09:21
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@AA-Turner AA-Turner enabled auto-merge (squash) May 1, 2025 08:23
@AA-Turner AA-Turner merged commit fe3c7e1 into python:main May 1, 2025
33 checks passed
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Fedora Stable Clang 3.x (tier-2) has failed when building commit fe3c7e1.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/441/builds/7851) and take a look at the build logs.
  4. Check if the failure is related to this commit (fe3c7e1) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/441/builds/7851

Failed tests:

  • test_functools

Summary of the results of the build (if available):

==

Click to see traceback logs
remote: Enumerating objects: 13, done.        
remote: Counting objects:   8% (1/12)        
remote: Counting objects:  16% (2/12)        
remote: Counting objects:  25% (3/12)        
remote: Counting objects:  33% (4/12)        
remote: Counting objects:  41% (5/12)        
remote: Counting objects:  50% (6/12)        
remote: Counting objects:  58% (7/12)        
remote: Counting objects:  66% (8/12)        
remote: Counting objects:  75% (9/12)        
remote: Counting objects:  83% (10/12)        
remote: Counting objects:  91% (11/12)        
remote: Counting objects: 100% (12/12)        
remote: Counting objects: 100% (12/12), done.        
remote: Compressing objects:  16% (1/6)        
remote: Compressing objects:  33% (2/6)        
remote: Compressing objects:  50% (3/6)        
remote: Compressing objects:  66% (4/6)        
remote: Compressing objects:  83% (5/6)        
remote: Compressing objects: 100% (6/6)        
remote: Compressing objects: 100% (6/6), done.        
remote: Total 13 (delta 6), reused 7 (delta 6), pack-reused 1 (from 1)        
From https://github.com/python/cpython
 * branch                    main       -> FETCH_HEAD
Note: switching to 'fe3c7e10d95235e3d7bea9273d61a968cdc83d86'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at fe3c7e10d95 Lint: Create a project-wide ``.ruff.toml`` settings file (#133124)
Switched to and reset branch 'main'

configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)

make: *** [Makefile:2453: buildbottest] Error 2

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

Successfully merging this pull request may close these issues.

3 participants