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

Improve file_length warnings when excluding comments #3654

Merged
merged 3 commits into from
Jun 17, 2021

Conversation

g-mark
Copy link
Contributor

@g-mark g-mark commented Jun 10, 2021

This PR adds two minor tweaks to how file_length warnings are reported when ignore_comment_only_lines: true:

  • Move warnings to the bottom of the file, rather than at the line corresponding to the abridged line count
  • Adds "excluding comments and whitespace" to the warning when appropriate
    Old: "File Length Violation: File should contain 400 lines or less: currently contains 401 (file_length)"
    New: "File Length Violation: File should contain 400 lines or less excluding comments and whitespace: currently contains 401 (file_length)"

file_length warnings remain unchanged when ignore_comment_only_lines: false

@g-mark g-mark marked this pull request as ready for review June 10, 2021 18:08
@SwiftLintBot
Copy link

SwiftLintBot commented Jun 10, 2021

12 Messages
📖 Linting Aerial with this PR took 0.72s vs 0.72s on master (0% slower)
📖 Linting Alamofire with this PR took 0.96s vs 0.96s on master (0% slower)
📖 Linting Firefox with this PR took 3.27s vs 3.26s on master (0% slower)
📖 Linting Kickstarter with this PR took 4.99s vs 4.98s on master (0% slower)
📖 Linting Moya with this PR took 0.45s vs 0.47s on master (4% faster)
📖 Linting Nimble with this PR took 0.4s vs 0.4s 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 1.53s vs 1.54s on master (0% faster)
📖 Linting SourceKitten with this PR took 0.33s vs 0.33s on master (0% slower)
📖 Linting Sourcery with this PR took 1.91s vs 1.92s on master (0% faster)
📖 Linting Swift with this PR took 3.15s vs 3.16s on master (0% faster)
📖 Linting WordPress with this PR took 6.11s vs 6.11s on master (0% slower)

Generated by 🚫 Danger

Co-authored-by: Yegor Chsherbatykh <ego1309@yandex.ru>
@marcelofabri marcelofabri merged commit 300bf77 into realm:master Jun 17, 2021
@marcelofabri
Copy link
Collaborator

Thanks!

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.

4 participants