Skip to content

Conversation

@Flamefire
Copy link
Contributor

@Flamefire Flamefire commented Jan 6, 2026

Type of Changes

Type
🐛 Bug fix

Description

Fix regression in 6ce6032:
In __init__ the options are not parsed yet and hence will always be the defaults.

Closes #10801

I was looking for a way to avoid this in general. However that requires a bit more refactoring to either:

  • Don't set PyLinter.options on __init__.py to detect access to it before being set (from config)
  • (Preferred): Don't init plugins until options are parsed. Registering would register the classes instead of the instances

Fix regression in 6ce6032:
In `__init__` the options are not parsed yet and hence will always be
the defaults.
@Flamefire
Copy link
Contributor Author

Hm towncrier create <IssueNumber>.<type> does create a file with .rst extension which the linter doesn't like. I'd consider it more useful to have the .rst extension to make it easier for editors to understand the format.

DanielNoord
DanielNoord previously approved these changes Jan 6, 2026
Copy link
Collaborator

@DanielNoord DanielNoord left a comment

Choose a reason for hiding this comment

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

Thanks! That's a stupid regression for me to make...

@DanielNoord
Copy link
Collaborator

Seems there are some small things we'll need to fix

@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.98%. Comparing base (4f6c241) to head (9858164).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #10802   +/-   ##
=======================================
  Coverage   95.98%   95.98%           
=======================================
  Files         176      176           
  Lines       19564    19566    +2     
=======================================
+ Hits        18779    18781    +2     
  Misses        785      785           
Files with missing lines Coverage Δ
pylint/checkers/imports.py 94.90% <100.00%> (+0.02%) ⬆️
pylint/checkers/utils.py 96.05% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

This comment has been minimized.

DanielNoord
DanielNoord previously approved these changes Jan 8, 2026
@DanielNoord
Copy link
Collaborator

@Flamefire There is unfortunately still a lint failure

@github-actions

This comment has been minimized.

With the fix of honoring the config the import is now correctly
identified using the overwrite `known-standard-library=_string`
@Flamefire
Copy link
Contributor Author

@Flamefire There is unfortunately still a lint failure

That is actually in a file I didn't touch. What happened:

@DanielNoord DanielNoord enabled auto-merge (squash) January 10, 2026 20:52
@DanielNoord DanielNoord merged commit 5a770e3 into pylint-dev:main Jan 10, 2026
44 checks passed
pylint-backport bot pushed a commit that referenced this pull request Jan 10, 2026
Fix regression in 6ce6032:
In `__init__` the options are not parsed yet and hence will always be
the defaults.

With the fix of honoring the config the import is now correctly
identified using the overwrite `known-standard-library=_string`

(cherry picked from commit 5a770e3)
@github-actions
Copy link
Contributor

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit 9858164

Pierre-Sassoulas pushed a commit that referenced this pull request Jan 10, 2026
…cker (#10810)

Fix setting options for import order checker (#10802)

Fix regression in 6ce6032:
In `__init__` the options are not parsed yet and hence will always be
the defaults.

With the fix of honoring the config the import is now correctly
identified using the overwrite `known-standard-library=_string`

(cherry picked from commit 5a770e3)

Co-authored-by: Alexander Grund <[email protected]>
@Flamefire Flamefire deleted the import-order branch January 11, 2026 11:19
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.

Options for wrong-import order ignored

2 participants