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 — Fix false positive on concept declaration by armandas · Pull Request #288 · cpplint/cpplint

Conversation

@armandas

@armandas armandas commented Sep 10, 2024

Copy link
Copy Markdown
Contributor

My attempt to fix #225, since #229 seems to be dead.

I used a requires keyword for concept detection, as the concept keyword could be a few lines above the opening brace.
Not 100% on the regex, so if someone could check it, I would appreciate it.

Sorry, something went wrong.

Uh oh!

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

All reactions
armandas added 2 commits September 10, 2024 14:36
@armandas
Add concept tests.
0aadb43
@armandas
Add exception rule for concepts.
dd194e8
aaronliu0130
aaronliu0130 approved these changes Sep 10, 2024
View reviewed changes

@aaronliu0130 aaronliu0130 left a comment

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.

This is a massive step up, though there is the very rare case of an identifier being named "requires" and the user linting a pre-C++20 file. It would be great if we could work out a way to also require the "concept" keyword, but I would be happy to merge this as-is if you can't figure it out.

Sorry, something went wrong.

Uh oh!

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

All reactions
@aaronliu0130 aaronliu0130 mentioned this pull request Sep 10, 2024
Fix false positive readability/braces warning for trailing comma on c… #229
Closed
@armandas

armandas commented Sep 10, 2024

Copy link
Copy Markdown
Contributor Author

If I understand correctly, the only issue with someone using requires as a name, is it would result in }; not being detected. If my assumption is correct, I don't think it's a huge issue.

One way to go about fixing that is to go through the preceding lines and look for concept. The hard question is when to stop. Do we look for a semi-colon, empty line?

All reactions

Sorry, something went wrong.

Uh oh!

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

@aaronliu0130

aaronliu0130 commented Sep 17, 2024

Copy link
Copy Markdown
Member

Yeah, that's what I meant. Like I said, it's probably not really an issue if we don't see a good way..

armandas 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.

@aaronliu0130
Add to changelog
d78ba71
@aaronliu0130
aaronliu0130 merged commit b29d3ee into cpplint:develop Sep 17, 2024
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

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.

C++20 concepts require a semicolon after the braces

Uh oh!

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

2 participants

@armandas @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.