-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Enable prettier #6863
Enable prettier #6863
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please hold until the number of open PRs is at a minimum.
How well does that rule out with the recently added integrations like ESLint on ci.j? E.g. in case of a violation found Do we really need (and want) prettier for markdown and yaml? It looks like it's prefectly fine for frontend files only, though what about handlebars? |
Basically: https://prettier.io/docs/en/integrating-with-linters.html A bit further to this, prettier's opinion is you don't need to know what is wrong, just run the format command and it will fix it for you, so there's no CI view or local tool you need to run it and diff it to see what the changes are.
🤷 can back it out if we don't want it.
It doesn't support handlebars in the core (https://github.com/timja/jenkins/blob/22022993b29b5498e7ec272a45cd43359951da5c/war/.prettierignore#L24) I did find a plugin but it seems basically unused so not sure about it (https://github.com/ratierd/prettier-plugin-hbs) |
no change in this PR requested, I'll mark as on hold for a bit unless others disagree
Please take a moment and address the merge conflicts of your pull request. Thanks! |
(<a | ||
href="https://docs.oracle.com/javase/8/docs/technotes/guides/net/properties.html" | ||
>See JDK networking properties for more details</a | ||
>) to enable internet connection, you can specify the HTTP proxy server name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty unfortunate.
cc @jenkinsci/sig-ux |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI build seems to fail on Windows.
Windows attempts to enforce CRLF with prettier, but the files use LF, as configured. |
Doesn't seem to do that in general. Installed java,maven and git Lint passed just fine. Ran out of time but I'll start a VM based off of the CI image later on. Would ❤️ it if someone on Windows already could take a look. I've had a look through the prettier issues, as far as I can tell it tries to autodetect line endings and leaves them alone, (it also supports configuring an explicit one). We have a .gitattributes set for auto eol conversion which I think leaves them alone in the checked out code but will convert on check in. |
That was the case when I ran |
It seems like that is somewhat recommended for windows: |
(you can ignore merge conflicts they are easily addressed but I don't want to constantly be doing it) |
/label ready-for-merge This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
Previously it was just looking at war/
Backported to:
|
Caused JENKINS-69498 |
What might have been obvious to the author but took me a long time to figure out, and seems to be missing from any guides: how you actually fix warnings. AFAICT: mvn -pl war frontend:yarn -Dfrontend.yarn.arguments=lint:fix |
Ah it was in a guide here but got dropped through all the rebasing accidentally I’ve had a PR open for a couple of weeks to automatically fix these on commit: |
Those of us who hate Git hooks will never use #7075, so I think it is worth improving the error message and/or documentation to instruct the user about how to fix lint errors using Maven. |
Broke |
Caused JENKINS-70788. |
Broke |
Need to find jenkinsci#6863 (comment) every fucking time
Ref #5916 (comment)
Automatically lint (and fix) files supported by prettier
Prettier is an opinionated formatter that can be used to reformat code to match a consistent style.
I've integrated
eslint
with it so that they won't conflictPrettier automatically reads the
.editorconfig
file to read some basic options as well.Specific sections where the layout produced by prettier is harder to read than what the developer wants can be disabled with https://prettier.io/docs/en/ignore.html
If this is accepted I plan to add a
.git-blame-ignore-revs
file so this change is ignored in blames.Interesting files that changed are:
war/package.json
war/pom.xml
war/.prettierignore
war/.eslintrc.js
CONTRIBUTING.md