Checkstyle vs. nonJavadoc comments? - comments

My company requires specific comment header blocks at the top of a file, prior to class definitions, and methods.
I'm using the Regexp in the config file to validate the file header comments. If there is a nonJavaDoc comment before a class or method, can I access the text?
My clunky solution is to get a CTOR_DEF or METHOD_DEF, then get the line number...then get the filecontents...find the line, then try to backup to the comment header.
Is there a way to get the text of nonJavaDoc comments in context? Thanks.

Your clunky approach is the only viable one. I would suggest that you can use the method FileContents.getCppComments() to get a map of all C++ comments in a file.
You may also find the method FileContents.lineIsComment() is useful.

Related

How can I comment on prettierrc file

I know json file cannot add comments unless I have “_comment”:”comment content”.
However, with .prettierrc file having this is going to interfere with prettier configuration.
Is there any good way of commenting?
Prettier's configurations file doesn't have to be JSON. It can be written in JavaScript too (.prettierrc.js or prettier.config.js), with as many comments as you want.
See https://prettier.io/docs/en/configuration.html

conditional include in asciidoc

I am using Spring RestDoc together with AsciiDoc to describe my rest api. RestDoc generates different files depending if there are request parameters described / response fields etc. I would like to have one template conditionally including whatever file exists.
something like this:
Request:
include::{reqresPath}/http-request.adoc[]
Response:
include::{reqresPath}/http-response.adoc[]
Parameters:
ifeval::[{{reqresPath}/request-parameters.adoc}.exists]
include::{reqresPath}/request-parameters.adoc[]
endif::[]
ifeval::[{{reqresPath}/request-parameters.adoc}.exists]
include::{reqresPath}/request-parameters.adoc[]
endif::[]
or at least exclude warnings in case of a missing file. But I could not figure out how to suppress these.
As of today, where is no operator for ifeval available, which can be used to check the existence of a file.
The way I would go is to write an extension for Asciidoctor, which can also be done by using Java. If your projects is big enough, I would suggest to go for this solution.
The most extreme way is to make a custom TemplatedSnippet which is generating an empty snippet to be included...
I hope there is a better way to do this.
Edit:
Take a look of http://asciidoctor.org/docs/user-manual/#by-tagged-regions

Jmeter - How do I add comments to a parameter file?

This may be a somewhat basic question, but how do I add comments to a parameter file for a Jmeter test?
Have seen what purport to be examples using both # and //.
Which is correct?
In need of this as I have a number of tests using a lot of parameters and I need to comment them up such that the next guy to run them will have an easier time understanding them.
Thanks,
Iain
For you parameter file which is a properties file, comment will be specified through
#

Is there a method for pull quotes?

Is there an existing method for pull quotes with Pelican? When you're reading an article, and there are balloons with key sentence fragments or excerpts to highlight the area. Ideally, I want to write the text once, and just surround it with whatever delimeter is appropriate and have the template do its magic.
An outdated plugin is available at https://github.com/arocks/markdown-pullquote. With a little tweaking - it works!

Is there a systematic way in VisualWorks way of generating classes comments?

Is there a systematic way in VisualWorks way of generating classes comments. or is it just expected to write them manually when selecting their comment tabs?
It seems like an organized structure for defining abstract data types, instance etc...
Thought maybe there was a comment generator feature
the comments are meant to contain the intent and purpose of the class, there's no way the computer can understand your intentions.
A class comment can be generated automatically by right clicking the comment text and selecting “Generate Default Comment” from the menu.
The generated comment is rather useless, and you should try to document the class using your own standard.

Resources