Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discussion: Lint Jelly files? #8706

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

janfaracik
Copy link
Contributor

@janfaracik janfaracik commented Nov 20, 2023

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

@janfaracik janfaracik marked this pull request as draft November 20, 2023 16:27
"overrides": [
{
"files": "*.jelly",
"options": { "parser": "html", "printWidth": 250 }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set printWidth fairly high otherwise attributes get split onto new lines, e.g.

<st:compress 
  xmlns:j="jelly:core" 
  xmlns:st="jelly:stapler" 
  xmlns:d="jelly:define" 
  xmlns:l="/lib/layout" 
  xmlns:t="/lib/hudson" 
  xmlns:f="/lib/form" 
  xmlns:i="jelly:fmt">

I don't personally find this beneficial (at least for namespace declarations).

@NotMyFault
Copy link
Member

NotMyFault commented Nov 23, 2023

No objections from me, if linting works consistently 👍

@timja
Copy link
Member

timja commented Nov 23, 2023

Fine with me if you can get a green build

@github-actions github-actions bot added the unresolved-merge-conflict There is a merge conflict with the target branch. label Nov 24, 2023
Copy link

Please take a moment and address the merge conflicts of your pull request. Thanks!

@github-actions github-actions bot removed the unresolved-merge-conflict There is a merge conflict with the target branch. label Nov 26, 2023
@timja
Copy link
Member

timja commented Nov 26, 2023

The linting is breaking something

@github-actions github-actions bot added the unresolved-merge-conflict There is a merge conflict with the target branch. label Nov 28, 2023
Copy link

Please take a moment and address the merge conflicts of your pull request. Thanks!

@github-actions github-actions bot removed the unresolved-merge-conflict There is a merge conflict with the target branch. label Dec 11, 2023
@janfaracik
Copy link
Contributor Author

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.

@janfaracik janfaracik mentioned this pull request Dec 11, 2023
@timja
Copy link
Member

timja commented Dec 11, 2023

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 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 mangling rss20.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

@github-actions github-actions bot added the unresolved-merge-conflict There is a merge conflict with the target branch. label Dec 13, 2023
Copy link

Please take a moment and address the merge conflicts of your pull request. Thanks!

@timja timja added web-ui The PR includes WebUI changes which may need special expertise needs-ath-build Needs to run through the full acceptance-test-harness suite needs-test-fix One or more test case(s) need to be updated labels Dec 16, 2023
@github-actions github-actions bot added unresolved-merge-conflict There is a merge conflict with the target branch. and removed unresolved-merge-conflict There is a merge conflict with the target branch. labels Feb 28, 2024
Copy link

github-actions bot commented Mar 4, 2024

Please take a moment and address the merge conflicts of your pull request. Thanks!

@github-actions github-actions bot removed the unresolved-merge-conflict There is a merge conflict with the target branch. label Mar 11, 2024
@github-actions github-actions bot added the unresolved-merge-conflict There is a merge conflict with the target branch. label Mar 14, 2024
Copy link

Please take a moment and address the merge conflicts of your pull request. Thanks!

@github-actions github-actions bot added unresolved-merge-conflict There is a merge conflict with the target branch. and removed unresolved-merge-conflict There is a merge conflict with the target branch. labels Mar 18, 2024
Copy link

Please take a moment and address the merge conflicts of your pull request. Thanks!

@github-actions github-actions bot removed the unresolved-merge-conflict There is a merge conflict with the target branch. label Mar 18, 2024
@github-actions github-actions bot added the unresolved-merge-conflict There is a merge conflict with the target branch. label Mar 26, 2024
Copy link

Please take a moment and address the merge conflicts of your pull request. Thanks!

@github-actions github-actions bot removed the unresolved-merge-conflict There is a merge conflict with the target branch. label Mar 26, 2024
Copy link

Please take a moment and address the merge conflicts of your pull request. Thanks!

@github-actions github-actions bot added the unresolved-merge-conflict There is a merge conflict with the target branch. label Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ath-build Needs to run through the full acceptance-test-harness suite needs-test-fix One or more test case(s) need to be updated unresolved-merge-conflict There is a merge conflict with the target branch. web-ui The PR includes WebUI changes which may need special expertise
Projects
None yet
4 participants