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

Add command to generate rules documentation #1107

Merged
merged 6 commits into from
Jul 2, 2017
Merged

Add command to generate rules documentation #1107

merged 6 commits into from
Jul 2, 2017

Conversation

marcelofabri
Copy link
Collaborator

@marcelofabri marcelofabri commented Jan 2, 2017

Will fix #1078

This produces a markdown looking like this.

Next steps:

  • Add a target on Makefile to run this command and output it to a file.
  • List rules configuration. In order to do this right, we'd need to change a bit the RuleConfiguration protocol to provide more information about the parameters.
  • Add a detailedDescription: String? on RuleDescription that would be used to generate this. All descriptions currently were thought for console and Xcode usage and we should go into more details in the docs. @jpsim did an awesome job on the 0.14 release blog post that could be used as an inspiration.
  • Add a Danger check to validate that the markdown was updated if a new rule is being created.

@SwiftLintBot
Copy link

SwiftLintBot commented Jan 2, 2017

2 Warnings
⚠️ Big PR
⚠️ This PR may need tests.
12 Messages
📖 Linting Aerial with this PR took 0.36s vs 0.34s on master (5% slower)
📖 Linting Alamofire with this PR took 2.31s vs 2.28s on master (1% slower)
📖 Linting Firefox with this PR took 10.03s vs 9.98s on master (0% slower)
📖 Linting Kickstarter with this PR took 14.86s vs 14.35s on master (3% slower)
📖 Linting Moya with this PR took 0.67s vs 0.65s on master (3% slower)
📖 Linting Nimble with this PR took 1.33s vs 1.3s on master (2% slower)
📖 Linting Quick with this PR took 0.44s vs 0.43s on master (2% slower)
📖 Linting Realm with this PR took 2.15s vs 2.0s on master (7% slower)
📖 Linting SourceKitten with this PR took 0.87s vs 0.86s on master (1% slower)
📖 Linting Sourcery with this PR took 2.81s vs 2.67s on master (5% slower)
📖 Linting Swift with this PR took 9.87s vs 9.5s on master (3% slower)
📖 Linting WordPress with this PR took 10.03s vs 9.79s on master (2% slower)

Generated by 🚫 Danger

@codecov-io
Copy link

codecov-io commented Jan 2, 2017

Codecov Report

Merging #1107 into master will decrease coverage by 0.7%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1107      +/-   ##
==========================================
- Coverage   87.96%   87.25%   -0.71%     
==========================================
  Files         197      198       +1     
  Lines        9761     9840      +79     
==========================================
  Hits         8586     8586              
- Misses       1175     1254      +79
Impacted Files Coverage Δ
Source/swiftlint/main.swift 0% <0%> (ø) ⬆️
Source/swiftlint/Commands/RulesDocsCommand.swift 0% <0%> (ø)

Continue to review full report at Codecov.

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

@ghost
Copy link

ghost commented Jan 2, 2017

It would also be good if this generated a Table of Contents for the top of the Markdown file. As we keep adding rules, this is going to be become one loooooong file.

@marcelofabri marcelofabri changed the title Add command to generate rules documentation [WIP] Add command to generate rules documentation Jan 24, 2017
@marcelofabri
Copy link
Collaborator Author

We probably should use Sourcery for this instead

@marcelofabri
Copy link
Collaborator Author

We probably should use Sourcery for this instead

Actually, that won't work 😅

@marcelofabri marcelofabri changed the title [WIP] Add command to generate rules documentation Add command to generate rules documentation Jul 2, 2017
@marcelofabri
Copy link
Collaborator Author

🚢

@marcelofabri marcelofabri merged commit 85cdcbe into realm:master Jul 2, 2017
@marcelofabri marcelofabri deleted the rules_docs branch July 2, 2017 22:53
@jpsim
Copy link
Collaborator

jpsim commented Jul 11, 2017

Oh my, I'm reviewing this now finally and this is soooo cool. This is a very nice addition to the project.

I'm very happy you did this. I was expecting to have more nitpicks, but really I just have #1660.

@marcelofabri
Copy link
Collaborator Author

🎉

I hope we can inprove this even more in the future with rule configurations and better descriptions for rules 🙌

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.

Show description of rule
5 participants