How can I comment on prettierrc file - comments

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

Related

How to divide the changelog.yaml into subsections?

I would like to separate each change of the databaseChangeLog in YAML format into its own file (again YAML) and include/import it somehow. It should be in way such that I can use a FileSystemAccessor or ClassPathAccessor to load it again.
Is there some example how to do that?
Thanks,
Dieter
The way to do this is described at https://www.liquibase.org/bestpractices.html
The example given shows XML formatted changelogs, but the basic idea would be the same for YAML formatted changelogs.
Leave me a comment and I can generate a sample in YAML.
After some searching I found this on the liquibase repo:
https://github.com/liquibase/liquibase/blob/master/liquibase-core/src/test/resources/liquibase/parser/core/yaml/doubleNestedChangeLog.yaml
It is an example how you can separate your yaml files analog to the xml as shown by SteveDonies link.

Comments in _CoqProject

Is there a way to have comments in a _CoqProject file?
I'd like to compile only part of a library, without completely removing all the other files from the _CoqProject file.
# is treated as a comment-the-rest-of-the-line symbol.
I think it is not documented as of now (see issue #7647). But the source code and some experiments show that it works.

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

Is there a way I can use a different extension than .txt such as .log or .csv when using ApprovalTests?

I want the content to remain a text file, so code such as:
Approvals.Verify("some actual result as text");
Should continue to work. But I would like the approval tests to write to a ..approval.csv file or a ..approval.log file instead of ..approval.txt file.
I looked through the code and I think I may need to create a custom IApprovalWriter, but I also notice that the ExtensionWithDot property is read/write, so I'm wondering how this can be set.
Does anyone know how to do that?
ApprovalTests.Approvals.Verify(WriterFactory.CreateTextWriter(text, fileExtensionWithoutDot));
or for your example:
Approvals.Verify(WriterFactory.CreateTextWriter("some actual result as text", "log"));
Happy Testing!

Checkstyle vs. nonJavadoc 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.

Resources