Comments configuration#32
Conversation
This parameter should be treated in context of the embedded file and depend on the type of the programming language of the embedded file. Javadoc, and KDoc are only two formats that use the same convention for the comments ( For other programming languages that we use (Go, Python, JavaScript, TypeScript, etc.) we should treat comments according to the language contentions. For some file formats, the Please have a look around of the file types we use in our projects and use them for sensible defaults. |
dmytro-kashcheiev
left a comment
There was a problem hiding this comment.
@Vladyslav-Kuksiuk LGTM with minor comments.
| ) | ||
|
|
||
| // VisualBasicCommentFilter filters the Visual Basic comment forms: | ||
| // - documentation comments starting with `”'`; |
There was a problem hiding this comment.
Are we sure? to many quotes maybe typo?
There was a problem hiding this comment.
It is a documentation style of the Visual Basic('''), but IDEA by some reasons converts two single quotes('') into ”.
| warnUnsupportedCommentsMode(filePath, mode, embeddingDocPath, embeddingLine, entry.supportedModes) | ||
|
|
||
| return entry.filter, true |
There was a problem hiding this comment.
Not sure about this. Still, the comment rules are applied to an explicit fragment, which means that we know the type of the source code.
In that case, probably it's not correct to simply warn about the misconfiguration and after return some filter. Isn't it should be same as above that in that case we return nil, false ?
|
@dmytro-kashcheiev, @Oleg-Melnik, why does this PR hang unmerged that long? Do you expect me to do it? |
This PR provides comments filtration option.
How to use
Add the
commentsparameter to theembed-codetag.Supported values
all— retain all comments. This is the default.none— strip all recognized comments.documentation— retain documentation comments such as Javadoc, KDoc etc.regular— retain regular comments, including block and inline comments, but strip documentation comments.inline— retain regular inline comments such as//.block— retain regular block comments such as/* */.Not every mode has a distinct meaning for every supported file type.
For example, XML, HTML, and YAML support only
allandnone.Supported formats
Comment filtering is supported for:
Unsupported file types are left unchanged, and a warning is emitted when comment filtering other than
allis requested.Resolves this issue.
Additional changes
checkmode "outdated" output and throw error on it: