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 — Ruff rules PT for pytest style by cclauss · Pull Request #332 · cpplint/cpplint

Conversation

@cclauss

@cclauss cclauss commented Mar 8, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Blocked by #333 or similar.

  • Add ruff format to pre-commit #333 merged.

https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt

Python 3.x (3.13.2) on macOS-latest...

Before:
============================= 214 passed in 21.21s =============================

After:
============================= 221 passed in 21.00s =============================

Let's leave this a DRAFT pull request until after we add ruff format or similar (#333) to pre-commit because these transforms create very long lines (288 char) that must be formatted to fit in the 120 character per lint limit.

Sorry, something went wrong.

Uh oh!

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

All reactions
@cclauss
cclauss force-pushed the ruff-rules-PT-for-pytest branch 3 times, most recently from a3ffabe to c4b285f Compare March 8, 2025 14:13
cclauss
cclauss commented Mar 8, 2025
View reviewed changes
Comment thread .flake8 Resolved

Uh oh!

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

@aaronliu0130

aaronliu0130 commented Mar 8, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Running black on this to solve the line length issues (while astral-sh/ruff#6936 won't be implemented in the near future) produced some interesting results: black.patch

Not entirely mergeable either since this also reformats the style of parameter indentation in function calls.

All reactions

Sorry, something went wrong.

Uh oh!

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

@cclauss

cclauss commented Mar 8, 2025

Copy link
Copy Markdown
Member Author

What is wrong with

reformats the style of parameter indentation in function calls.

as long as it is automatic and consistent with other Python codebases?

All reactions

Sorry, something went wrong.

Uh oh!

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

@aaronliu0130

aaronliu0130 commented Mar 8, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

It would be a new inconsistency introduced to our own codebase. We have to decide whether we want that, to which I’m neutral.

All reactions

Sorry, something went wrong.

Uh oh!

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

@cclauss cclauss mentioned this pull request Mar 10, 2025
Refactor tests and metadata #317
Merged
@aaronliu0130

aaronliu0130 commented Mar 10, 2025 via email

Copy link
Copy Markdown
Member
What is wrong with
Nothing, just something I thought was noteworthy.
All reactions

Sorry, something went wrong.

Uh oh!

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

@aaronliu0130

aaronliu0130 commented Mar 11, 2025

Copy link
Copy Markdown
Member

On #317, which the unittest changes are blocking, I said:

That is still a draft, no? Do you want to me to replace your PR's unittest file with the black-formatted one I provided and then merge it?

If you don't object, I'll do that when I get home in 8 hours today.

All reactions

Sorry, something went wrong.

Uh oh!

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

aaronliu0130
aaronliu0130 reviewed Mar 11, 2025
View reviewed changes
Comment thread cpplint_unittest.py Resolved

Uh oh!

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

@aaronliu0130

aaronliu0130 commented Mar 11, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

On second thought, I think I should implement the unittest dropping on the refactoring PR instead, since it's more topic-related and our branches conflict quite a bit (plus some of the changes here were already made in the refactoring branch).

All reactions

Sorry, something went wrong.

Uh oh!

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

@aaronliu0130

aaronliu0130 commented Mar 11, 2025

Copy link
Copy Markdown
Member

...that turned out to be an even worse idea since this PR does replace the asserts. I'll just do the black thing then.

All reactions

Sorry, something went wrong.

Uh oh!

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

@aaronliu0130

aaronliu0130 commented Mar 11, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Do we need to do the setUp() and tearDown() for every little small test, as it is in with the run_around_tests() fixture rn? I feel like it'd do if these functions only run once every session.

All reactions

Sorry, something went wrong.

Uh oh!

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

@cclauss

cclauss commented Mar 11, 2025

Copy link
Copy Markdown
Member Author

Let’s put this PR on hold. It is still draft. We can merge #317 first.

  • Refactor tests and metadata #317
aaronliu0130 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@cclauss
cclauss force-pushed the ruff-rules-PT-for-pytest branch 3 times, most recently from 68b0d33 to 9045069 Compare March 15, 2025 21:43
@aaronliu0130

aaronliu0130 commented Mar 15, 2025

Copy link
Copy Markdown
Member

Sorry, I didn't realize that you had reversed the changes removing unittest from unittests but also couldn't make a proposal as the relevant lines are outside the diff range. Treat my commit as you wish.

All reactions

Sorry, something went wrong.

Uh oh!

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

@cclauss
cclauss force-pushed the ruff-rules-PT-for-pytest branch 7 times, most recently from fe04958 to 9a1934b Compare March 16, 2025 12:10
@cclauss
cclauss marked this pull request as ready for review March 16, 2025 12:15
@cclauss
cclauss requested a review from aaronliu0130 March 16, 2025 12:15
@cclauss cclauss changed the title DRAFT: Ruff rules PT for pytest style Ruff rules PT for pytest style Mar 16, 2025
@cclauss
cclauss requested a review from jayvdb March 16, 2025 12:15
aaronliu0130
aaronliu0130 previously approved these changes Mar 16, 2025
View reviewed changes
@aaronliu0130
aaronliu0130 dismissed their stale review March 16, 2025 14:48

doesn't fix running with pytest

aaronliu0130
aaronliu0130 requested changes Mar 16, 2025
View reviewed changes
Comment thread cpplint_unittest.py Resolved

Uh oh!

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

Comment thread cpplint_unittest.py Resolved

Uh oh!

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

Comment thread cpplint_unittest.py Resolved

Uh oh!

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

@cclauss
Ruff rules SIM for simplification (#337)
81a65e6
https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
@cclauss
cclauss force-pushed the ruff-rules-PT-for-pytest branch from 9a1934b to 81a65e6 Compare March 16, 2025 15:31
@cclauss

cclauss commented Mar 16, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

doesn't fix running with pytest

Local testing I do:
% python3 -m venv .venv
% source .venv/bin/activate
% python -m pip install --editable ".[dev]"
% pytest

python cpplint_clitest.py and python cpplint_unittest.py also work in an activated venv.

All reactions

Sorry, something went wrong.

Uh oh!

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

aaronliu0130 added 2 commits March 16, 2025 13:58
@aaronliu0130
fix unittests category verification for PT and deduplicate setup/tear…
35b6cac
…down
@aaronliu0130
add missing build/deprecated test and remove unused readability/strin…
2c94631
…gs category
aaronliu0130
aaronliu0130 approved these changes Mar 16, 2025
View reviewed changes
@aaronliu0130
aaronliu0130 merged commit 0391a42 into develop Mar 16, 2025
@cclauss
cclauss deleted the ruff-rules-PT-for-pytest branch March 17, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aaronliu0130 aaronliu0130 aaronliu0130 approved these changes
@jayvdb jayvdb Awaiting requested review from jayvdb

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

@cclauss @aaronliu0130
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.