Skip to content

Extend clippy to include clippy::pedantic #695

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

Merged
merged 13 commits into from
Jun 26, 2023
Merged

Extend clippy to include clippy::pedantic #695

merged 13 commits into from
Jun 26, 2023

Conversation

davidhewitt
Copy link
Contributor

@davidhewitt davidhewitt commented Jun 26, 2023

Change Summary

Adds -W clippy::pendantic to our lint job. Because this namespace is extremely prescriptive, I re-enabled all the rules where we currently have lint errors.

I've then run through a bunch of the easy wins and fixed those up. Over time we may want to snipe off some of the other rules, although I expect some to always be permitted.

Related issue number

Closes #666

Checklist

  • Unit tests for the changes exist
  • Documentation reflects the changes where applicable
  • Pydantic tests pass with this pydantic-core (except for expected changes)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Selected Reviewer: @adriangb

@davidhewitt
Copy link
Contributor Author

please review

@codecov-commenter
Copy link

Codecov Report

Merging #695 (4927296) into main (4c2a8f8) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #695      +/-   ##
==========================================
+ Coverage   93.72%   93.73%   +0.01%     
==========================================
  Files          99       99              
  Lines       13804    13814      +10     
  Branches       25       25              
==========================================
+ Hits        12938    12949      +11     
+ Misses        860      859       -1     
  Partials        6        6              
Impacted Files Coverage Δ
pydantic_core/__init__.py 81.81% <ø> (ø)
src/errors/validation_exception.rs 93.84% <ø> (ø)
src/argument_markers.rs 86.88% <100.00%> (ø)
src/build_tools.rs 82.47% <100.00%> (ø)
src/definitions.rs 96.36% <100.00%> (ø)
src/errors/line_error.rs 93.02% <100.00%> (ø)
src/errors/location.rs 97.27% <100.00%> (ø)
src/errors/types.rs 83.74% <100.00%> (ø)
src/input/datetime.rs 98.33% <100.00%> (ø)
src/input/return_enums.rs 85.68% <100.00%> (ø)
... and 28 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dfae003...4927296. Read the comment docs.

@codspeed-hq
Copy link

codspeed-hq bot commented Jun 26, 2023

CodSpeed Performance Report

Merging #695 dh/clippy (4927296) will improve performances by 10.7%.

Summary

🔥 1 improvements
❌ 0 regressions
✅ 124 untouched benchmarks

🆕 0 new benchmarks
⁉️ 0 dropped benchmarks

Benchmarks breakdown

Benchmark main dh/clippy Change
🔥 test_set_of_ints_core_json_duplicates 5.8 ms 5.2 ms +10.7%

Copy link
Member

@adriangb adriangb left a comment

Choose a reason for hiding this comment

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

I didn't review every change in detail but what I did see looked good, also no changes in tests or benchmarks. So 👍 from here.

@davidhewitt davidhewitt merged commit a6e9db5 into main Jun 26, 2023
@davidhewitt davidhewitt deleted the dh/clippy branch June 26, 2023 16:16
@davidhewitt davidhewitt mentioned this pull request Jun 28, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider to apply some clippy pedantic rules
3 participants