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 for comprehensions and performance by cclauss · Pull Request #329 · cpplint/cpplint

Conversation

@cclauss

@cclauss cclauss commented Mar 7, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

% ruff check --select=C4,PERF --output-format=concise

cpplint.py:60:21: C405 Unnecessary list literal (rewrite as a set literal)
cpplint.py:829:22: C404 Unnecessary list comprehension (rewrite as a dict comprehension)
cpplint.py:948:16: C405 Unnecessary list literal (rewrite as a set literal)
cpplint.py:1041:10: C405 Unnecessary list literal (rewrite as a set literal)
cpplint.py:1046:59: C405 Unnecessary list literal (rewrite as a set literal)
cpplint.py:1104:23: C417 Unnecessary `map()` usage (rewrite using a set comprehension)
cpplint.py:6072:5: PERF401 Use `list.extend` to create a transformed list
cpplint.py:6088:5: PERF401 Use `list.extend` to create a transformed list
cpplint.py:6096:5: PERF401 Use `list.extend` to create a transformed list
cpplint.py:6106:5: PERF401 Use `list.extend` to create a transformed list
cpplint.py:6743:31: C414 Unnecessary `list()` call within `sorted()`
cpplint.py:6744:17: C414 Unnecessary `list()` call within `sorted()`
cpplint.py:6930:7: PERF401 Use a list comprehension to create a transformed list
cpplint_unittest.py:4262:24: C405 Unnecessary list literal (rewrite as a set literal)
cpplint_unittest.py:4268:24: C405 Unnecessary list literal (rewrite as a set literal)
cpplint_unittest.py:4274:24: C405 Unnecessary list literal (rewrite as a set literal)
cpplint_unittest.py:4275:24: C405 Unnecessary list literal (rewrite as a set literal)
cpplint_unittest.py:4281:24: C405 Unnecessary list literal (rewrite as a set literal)
cpplint_unittest.py:4282:24: C405 Unnecessary list literal (rewrite as a set literal)
cpplint_unittest.py:4332:32: C405 Unnecessary list literal (rewrite as a set literal)
cpplint_unittest.py:4333:37: C405 Unnecessary list literal (rewrite as a set literal)
cpplint_unittest.py:4358:24: C405 Unnecessary list literal (rewrite as a set literal)
cpplint_unittest.py:4376:18: C405 Unnecessary list literal (rewrite as a set literal)
cpplint_unittest.py:5630:28: C405 Unnecessary list literal (rewrite as a set literal)
cpplint_unittest.py:5631:33: C405 Unnecessary list literal (rewrite as a set literal)
Found 25 errors.
No fixes available (20 hidden fixes can be enabled with the `--unsafe-fixes` option).

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-C4-and-PERF branch from bfa7806 to 13c4725 Compare March 7, 2025 14:21
jayvdb
jayvdb reviewed Mar 8, 2025
View reviewed changes
Comment thread cpplint.py Outdated

@jayvdb jayvdb Mar 8, 2025

Copy link
Copy Markdown
Member

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.

double space at "_USAGE " - odd that ruff isnt picking that up

Sorry, something went wrong.

Uh oh!

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

All reactions

@cclauss cclauss Mar 8, 2025

Copy link
Copy Markdown
Member Author

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.

This will be automatically fixed when we add ruff format to pre-commit.

Sorry, something went wrong.

Uh oh!

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

All reactions
@cclauss
cclauss requested review from aaronliu0130 and jayvdb March 8, 2025 06:16
@cclauss
cclauss force-pushed the ruff-rules-C4-and-PERF branch from 19ec1b4 to c2afaa7 Compare March 8, 2025 12:38
@cclauss
Ruff rules for comprehensions and performance
b181eaa
@cclauss
cclauss force-pushed the ruff-rules-C4-and-PERF branch from c2afaa7 to b181eaa Compare March 11, 2025 18:17
@cclauss

cclauss commented Mar 11, 2025

Copy link
Copy Markdown
Member Author

Reviews please.

All reactions

Sorry, something went wrong.

Uh oh!

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

@aaronliu0130
chore: add ruff stuff to changelog
5b91ea6
aaronliu0130
aaronliu0130 approved these changes Mar 11, 2025
View reviewed changes
@aaronliu0130
aaronliu0130 merged commit 776a72b into develop Mar 11, 2025
@cclauss
cclauss deleted the ruff-rules-C4-and-PERF branch March 11, 2025 21:34
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.

3 participants

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