Skip to content
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

replace config_overrides.patch_config by config_overrides.to_ruff_args #10436

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

hoel-bagard
Copy link
Contributor

Summary

Closes #10345

This PR removes the manual patch of the config by the overrides when doing the ecosystem checks, and instead uses the
--config option.

Test Plan

CI ?

Copy link

github-actions bot commented Mar 17, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -1 violations, +0 -0 fixes in 1 projects; 43 projects unchanged)

python/typeshed (+0 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select E,F,FA,I,PYI,RUF,UP,W

- stdlib/subprocess.pyi:134:1: E999 SyntaxError: unexpected EOF while parsing

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
E999 1 0 1 0 0

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@zanieb
Copy link
Member

zanieb commented Apr 12, 2024

Sorry I lost track of this. Is it ready for review?

@zanieb zanieb self-assigned this Apr 12, 2024
@hoel-bagard
Copy link
Contributor Author

It's not ready for review yet.

I'll look again for a way to unset keys. Sorry to have let this PR/issue take so long.

@hoel-bagard
Copy link
Contributor Author

hoel-bagard commented Apr 13, 2024

@zanieb I've tried to just set the value of the keys to unset to an empty string, but I don't know how to check whether this works or not.

When I run the ruff-ecosystem check locally I get the same error for all the repos, but the CI is passing. It doesn't seem to be related to the config override, but I could be wrong (could it be linked to the required-version not being overwritten ?). I'm adding it below in case you know why it appears.

<pre>ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --no-preview --select ALL</pre>
...
error: invalid value 'RUF9' for '--ignore <RULE_CODE>'

if value is None:
# Remove null values i.e. restore to default
target.pop(names[-1], None)
args.extend(["--config", f"{key} = ''"])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AlexWaygood Here I'm trying to unset / restore to default some values.

This is the part of the PR I'm the most unsure about, do you know if that's the correct way to do it ?

@hoel-bagard hoel-bagard marked this pull request as ready for review April 14, 2024 14:29
@MichaReiser MichaReiser marked this pull request as draft April 15, 2024 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use --config in ecosystem checks
2 participants