-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Update document to latest format #3621
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3621 +/- ##
=======================================
Coverage 31.01% 31.01%
=======================================
Files 114 114
Lines 10482 10482
=======================================
Hits 3251 3251
Misses 7231 7231
Continue to review full report at Codecov.
|
How did you make this change, manually or by some tools? I cannot trust my eyes reviewing this.. though I tend to be green light to merge |
dcaf093
to
6de6a78
Compare
``` (\n[ ]+)(((/// - parameter \w+:.*\s+)(///((\s+)|( \s+.+\s+)))?)*/// - parameter \w+:.*) ``` ``` $1/// - Parameters:$1$2 ```
``` /// - parameter (\w+):(.*)(\s+///(\n))*(\s+) ``` ``` /// - $1:$2$4$5 ```
``` /// (note|return|parameters|throws): ``` ``` /// - $1: ```
@liuxuan30 Basically regex + manually. I've add some details in the initial comment, include the format guideline and regex that I used. And I split the changes into separate commits, describe the regex in commit message. I think that would be useful for you guys to review. |
``` ((///)[ ]+[^-\n]+(\s+))?(((((/// - Parameters:\s+(/// (( - \w+:)|([^-]{1})).*\s+)+)\s+)|(/// - Returns:.*\s+(/// [^-]{1}.*\s+)*)|(/// - Note:.*\s+(/// [^-]{1}.*\s+)*)|(/// - Throws:.*\s+(/// [^-]{1}.*\s+)*))(///\n\s+)?)+) ``` ``` $1$2$3$15$7$17$13 ```
@@ -742,46 +775,47 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate | |||
} | |||
|
|||
/// * | |||
/// - note: (Equivalent of getCenter() in MPAndroidChart, as center is already a standard in iOS that returns the center point relative to superview, and MPAndroidChart returns relative to self)* | |||
/// - returns: The center point of the chart (the whole View) in pixels. | |||
/// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need a ///
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kemchenj is this one ok to resolve without any change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already removed.
@@ -55,8 +55,9 @@ open class ChartDataSet: ChartBaseDataSet | |||
// MARK: - Data functions and accessors | |||
|
|||
/// * | |||
/// - note: Calls `notifyDataSetChanged()` after setting a new value. | |||
/// - returns: The array of y-values that this DataSet represents. | |||
/// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need ///
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I regard *
as part of "Summary" section. And I am not really sure what it means, maybe it is some magic sign here for someone. So I just leave it here.😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jjatie any idea? If it's ok, it seems this PR can be merged now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The *
and the empty ///
can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I just push a new commit to remove them.
@kemchenj please check above comments. I found some inconsistence of |
@liuxuan30 Sorry for late reply. I could not find a proper regex for those inconsistent separator line behavior these days. So I just fixed it manually and I got a double check. Please review it again. |
do you forecast there would be more fixes for this PR? Otherwise we could get merged soon |
Nope, I think it won't be more fixes for this PR. |
Issue Link 🔗
Some of the document format were outdated and inconsistent. It leads to some weird compile warning like this:
So I think is time to update the document format.
Goals ⚽
Update all the existing document to latest format.
Sort section title in order [
Summary
,Note
,Parameters
,Throws
,Returns
]before:
after:
Uppercased the section title
/// - note:
->/// - Note:
/// - parameter:
->/// - Parameters:
/// - returns:
->/// - Returns:
/// - throws:
->/// - Throws:
Update parameters section format
before:
after:
Move property's
Returns
section content toSummary
before:
after:
Add empty line between summary and other section:
before:
after:
Implementation Details 🚧
Add missing
-
./// (note|return|parameters|throws):
/// - $1:
Remove property's
Returns
section./// - returns: (.+\s+((override|@IBOutlet|@objc|weak|unowned|lazy|static|class|open|public|private|fileprivate|internal)(\(set\))? )*(var|let))
/// $1
Update
Parameters
section format.Parameters
section.(\n[ ]+)(((/// - parameter \w+:.*\s+)(///((\s+)|( \s+.+\s+)))?)*/// - parameter \w+:.*)
$1/// - Parameters:$1$2
parameter
prefix./// - parameter (\w+):(.*)(\s+///(\n))*(\s+)
/// - $1:$2$4$5
Some edge case:
Charts/Source/Charts/Components/LegendEntry.swift
Charts/Source/Charts/Formatters/IValueFormatter.swift
Sort sections and add empty line between Summary and other sections.
((///)[ ]+[^-\n]+(\s+))?(((((/// - Parameters:\s+(/// (( - \w+:)|([^-]{1})).*\s+)+)\s+)|(/// - Returns:.*\s+(/// [^-]{1}.*\s+)*)|(/// - Note:.*\s+(/// [^-]{1}.*\s+)*)|(/// - Throws:.*\s+(/// [^-]{1}.*\s+)*))(///\n\s+)?)+)
$1$2$3$15$7$17$13
///
Uppercased the section title(regex)
Remove duplicated section(manually)
Fix a document error(manually)
Testing Details 🔍
N/A