Open gabor opened 3 years ago
@gabor can you elaborate a bit more on why it should escape it with a backslash as it looks like github can handle underscores pretty well even when unescaped? Any examples of where it broke or how to reproduce?
hi @tolzhabayev , thanks for looking at this issue!
the CI jobs that validate the changelog-markdown-file will fail in some situations. for example, i made a test pull request where i removed the escaping, and see how it failed: https://github.com/grafana/grafana/pull/42829
basically, if you run yarn run prettier:check
, it will complain if underscores are not escaped (seems not in every case, but it does for the case of $__interval
and $__interval_ms
)
@gabor I have looked more into it and it seems it should be working. I have tested it locally and it works for me 🤷
I have created a PR to bump the prettier
version, maybe that would help keeping it similar to the grafana
repository. Otherwise it would be good to see which execution failed to escape (maybe there is an error message, if you have a link to github action run logs).
@tolzhabayev hmm, i think the prettier that is failing is in the grafana/grafana
repo... you can reproduce it like this:
grafana/grafana
repogit checkout origin/gabor/changelog-escape-test
yarn install
git diff
.. this should show no changesyarn run prettier:write
git diff
.. this will show that prettier wants to change the CHANGELOG.md
fileso, in short:
CHANGELOG.md
prettier
check in grafana/grafana
is not happy with the format of that CHANGELOG.md
so, if you want prettier
-check in [2] be happy with the changes produces in [1], we either need to change [1], or change [2].
does this help?
maybe i'm misunderstanding something in the question, sorry 😄
we had pull-requests with
_
characters in the title, for examplehandle $__interval
. the changelog-generator should markdown-escape the_
, but it is not doing that currently.