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

Create rule S7121 Calls to c_str() should not implicitly recreate strings or string_views CPP-3435 #4391

Merged
merged 9 commits into from
Nov 7, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 8, 2024

You can preview this rule here (updated a few minutes after each push).

Review

A dedicated reviewer checked the rule description successfully for:

  • logical errors and incorrect information
  • information gaps and missing content
  • text style and tone
  • PR summary and labels follow the guidelines

@github-actions github-actions bot added the cfamily C / C++ / Objective-C label Oct 8, 2024
@frederic-tingaud-sonarsource frederic-tingaud-sonarsource changed the title Create rule S7121 Create rule S7121 Avoid redundant string creations from c_str CPP-3435 Oct 8, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the rule should also cover std::string_view as we would avoid recomuptng length. And title, and initial spec should be more focused.

I also make the std::string_view.

@tomasz-kaminski-sonarsource tomasz-kaminski-sonarsource changed the title Create rule S7121 Avoid redundant string creations from c_str CPP-3435 Create rule S7121 Calls to c_str() should not implicitly recreate strings or string_views CPP-3435 Oct 15, 2024
Copy link

Quality Gate passed Quality Gate passed for 'rspec-frontend'

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Copy link

Quality Gate passed Quality Gate passed for 'rspec-tools'

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@frederic-tingaud-sonarsource frederic-tingaud-sonarsource merged commit 289e7cf into master Nov 7, 2024
9 of 10 checks passed
@frederic-tingaud-sonarsource frederic-tingaud-sonarsource deleted the rule/add-RSPEC-S7121 branch November 7, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cfamily C / C++ / Objective-C
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants