GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Switch linting to ruff, use f-strings, fix lint errors and possible bugs by akx · Pull Request #3126 · docker/docker-py

Conversation

@akx

@akx akx commented May 11, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This PR is a bit on the big side, but it should be pretty straightforward to review commit by commit. A net line reduction
too!

It:

  • replaces .format and % string formatting with the more succinct and performant f-strings wherever possible (this was half powered by flynt, half manual work)
  • replaces the flake8 linter with the much faster, more capable ruff linter
  • ... and then starts to fix up various issues and possible bugs found by ruff. See each commit's message for details.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@akx
akx requested review from aiordache and ulyssessouza as code owners May 11, 2023 13:30
@akx
akx force-pushed the ruffify branch 2 times, most recently from 7f6a4d5 to 15bd6e0 Compare May 12, 2023 05:25
@SauravMaheshkar SauravMaheshkar mentioned this pull request May 15, 2023
chore: move configurations to pyproject.toml #3122
Closed
@akx
akx force-pushed the ruffify branch from 15bd6e0 to 03abdc7 Compare June 6, 2023 14:24
@akx akx mentioned this pull request Aug 15, 2023
feat: move websocket-client to extra dependency #3123
Merged
@akx
akx force-pushed the ruffify branch 2 times, most recently from 68a2d51 to 6fb7e6f Compare August 15, 2023 10:31
akx added 13 commits August 15, 2023 13:36
@akx
Replace string formatting with f-strings
8a3402c
Signed-off-by: Aarni Koskela <[email protected]>
@akx
Switch linting from flake8 to ruff
9313536
Signed-off-by: Aarni Koskela <[email protected]>
@akx
Get rid of star import
fad792b
Signed-off-by: Aarni Koskela <[email protected]>
@akx
Clean up unnecessary noqa comments
ec58856
Signed-off-by: Aarni Koskela <[email protected]>
@akx
Enable Ruff C rules and autofix
6014767
Signed-off-by: Aarni Koskela <[email protected]>
@akx
Enable Ruff B rules and autofix
8447f7b
Signed-off-by: Aarni Koskela <[email protected]>
@akx
Fix Ruff B904s (be explicit about exception causes)
6aec90a
Signed-off-by: Aarni Koskela <[email protected]>
@akx
Fix B005 (probably an actual bug too)
09f12f2
Signed-off-by: Aarni Koskela <[email protected]>
@akx
Fix B082 (no explicit stacklevel for warnings)
cc76c9c
Signed-off-by: Aarni Koskela <[email protected]>
@akx
Fix missing asserts or assignments
0566f12
Signed-off-by: Aarni Koskela <[email protected]>
@akx
Fix or noqa B003 (assigning to os.environ doesn't do what you expect)
3948540
Signed-off-by: Aarni Koskela <[email protected]>
@akx
Noqa pytest.raises(Exception)
a9a3775
Signed-off-by: Aarni Koskela <[email protected]>
@akx
Fix duplicate dict key literal (ruff F601)
c68d532
Signed-off-by: Aarni Koskela <[email protected]>
@akx
akx force-pushed the ruffify branch from 6fb7e6f to c68d532 Compare August 15, 2023 10:37
milas
milas approved these changes Aug 15, 2023
View reviewed changes

@milas milas left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks! I appreciate how methodical you were here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

akx reacted with heart emoji
All reactions
  • ❤️ 1 reaction
milas added a commit to milas/docker-py that referenced this pull request Aug 15, 2023
@milas
Merge branch 'ruffify'
803feb8
Manually merging docker#3126.
@milas
milas merged commit 8b9ad78 into docker:main Aug 15, 2023
@milas

milas commented Aug 15, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

FYI the integration test failure was because the test was broken [before this PR] - it was missing assert so the statements were no-ops, the linter caught that but the asserts were incorrect. I fixed the status code in the merge after comparing to real engine behavior.

(Also apologies for noise to anyone watching this repo, it appears my Git pushes might have caused a bunch of notification emails 😬)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@akx
akx deleted the ruffify branch December 21, 2023 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aiordache aiordache Awaiting requested review from aiordache
@ulyssessouza ulyssessouza Awaiting requested review from ulyssessouza
1 more reviewer
@milas milas milas approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@akx @milas
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.