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

Prevent crash for private types named _ in type_name rules #3972

Merged
merged 3 commits into from
May 10, 2022

Conversation

sinoru
Copy link
Contributor

@sinoru sinoru commented May 8, 2022

Fixes #3971

@SwiftLintBot
Copy link

SwiftLintBot commented May 8, 2022

12 Messages
📖 Linting Aerial with this PR took 0.98s vs 0.98s on master (0% slower)
📖 Linting Alamofire with this PR took 1.1s vs 1.11s on master (0% faster)
📖 Linting Firefox with this PR took 4.22s vs 4.21s on master (0% slower)
📖 Linting Kickstarter with this PR took 7.5s vs 7.49s on master (0% slower)
📖 Linting Moya with this PR took 0.56s vs 0.52s on master (7% slower)
📖 Linting Nimble with this PR took 0.41s vs 0.41s on master (0% slower)
📖 Linting Quick with this PR took 0.19s vs 0.18s on master (5% slower)
📖 Linting Realm with this PR took 9.99s vs 10.23s on master (2% faster)
📖 Linting SourceKitten with this PR took 0.33s vs 0.34s on master (2% faster)
📖 Linting Sourcery with this PR took 2.01s vs 2.02s on master (0% faster)
📖 Linting Swift with this PR took 3.21s vs 3.21s on master (0% slower)
📖 Linting WordPress with this PR took 7.72s vs 7.73s on master (0% faster)

Generated by 🚫 Danger

@codecov-commenter
Copy link

Codecov Report

Merging #3972 (3206d1b) into master (ca9217d) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3972      +/-   ##
==========================================
- Coverage   92.55%   92.55%   -0.01%     
==========================================
  Files         446      446              
  Lines       22490    22490              
==========================================
- Hits        20816    20815       -1     
- Misses       1674     1675       +1     
Impacted Files Coverage Δ
...ramework/Rules/Idiomatic/GenericTypeNameRule.swift 100.00% <100.00%> (ø)
...ftLintFramework/Rules/Idiomatic/TypeNameRule.swift 95.34% <100.00%> (ø)
...iftLintFramework/Extensions/String+SwiftLint.swift 89.39% <0.00%> (-1.52%) ⬇️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Copy link
Collaborator

@SimplyDanny SimplyDanny left a comment

Choose a reason for hiding this comment

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

Thank you for the bug report and your contribution!

Would you please add a test case that had caused the crash? You can do it like:

Example("...", excludeFromDocumentation: true)

The excludeFromDocumentation keeps the documentation clean and simple.

You may also credit yourself in the CHANGELOG.md.

@sinoru sinoru requested a review from SimplyDanny May 9, 2022 11:57
Copy link
Collaborator

@SimplyDanny SimplyDanny left a comment

Choose a reason for hiding this comment

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

Thank you for adding the tests! Now we just have to find the right place for them. 😉

Tests/SwiftLintFrameworkTests/TypeNameRuleTests.swift Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@sinoru sinoru changed the title Prevent type name’s out of bounds crashes Prevent crash for private types named _ in type_name rules May 10, 2022
@SimplyDanny SimplyDanny merged commit 809dcc6 into realm:master May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crashed when type name is _
4 participants