jenkins
jenkins copied to clipboard
discussion: Lint Jelly files?
For discussion purposes -
How do we feel about linting Jelly? Currently nigh every other file is linted in Jenkins and this works well. I'd propose including Jelly in that too, I've tweaked .prettierrc
to include Jelly files and the output seems to be quite sensible.
@jenkinsci/sig-ux
No objections from me, if linting works consistently 👍
Fine with me if you can get a green build
Please take a moment and address the merge conflicts of your pull request. Thanks!
The linting is breaking something
Please take a moment and address the merge conflicts of your pull request. Thanks!
So the tests are failing as certain xpath
selectors are no longer valid due to the whitespace changes, e.g. Add parameter
is now Add parameter
.
This can be fixed by setting htmlWhitespaceSensitivity
to strict
, see https://prettier.io/docs/en/options.html#html-whitespace-sensitivity and https://prettier.io/blog/2018/11/07/1.15.0#whitespace-sensitive-formatting. This brings its own issues however as it seems to be mangling rss20.jelly
and it's also no longer as opinionated.
So the tests are failing as certain
xpath
selectors are no longer valid due to the whitespace changes, e.g.Add parameter
is nowAdd parameter
.This can be fixed by setting
htmlWhitespaceSensitivity
tostrict
, see prettier.io/docs/en/options.html#html-whitespace-sensitivity and prettier.io/blog/2018/11/07/1.15.0#whitespace-sensitive-formatting. This brings its own issues however as it seems to be manglingrss20.jelly
and it's also no longer as opinionated.
This normally fixes xpath that is that sensitive: https://developer.mozilla.org/en-US/docs/Web/XPath/Functions/normalize-space
Please take a moment and address the merge conflicts of your pull request. Thanks!
Please take a moment and address the merge conflicts of your pull request. Thanks!
Please take a moment and address the merge conflicts of your pull request. Thanks!
Please take a moment and address the merge conflicts of your pull request. Thanks!
Please take a moment and address the merge conflicts of your pull request. Thanks!
Please take a moment and address the merge conflicts of your pull request. Thanks!
Going to close this - there's too many oddities after linting sadly. Will investigate again in the future if there's a better way. Thanks to those that commented.