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

File formatting improvements #88

Merged
merged 4 commits into from
Aug 8, 2019

Conversation

darxriggs
Copy link

No description provided.

@jakub-bochenski
Copy link

Thanks, but I would rather format this according to goolge style guide and add a formatting plugin (e.g. fmt-maven-plugin) to keep the files formatted.
WDYT?

@darxriggs
Copy link
Author

The performed changes are based on https://pre-commit.com/. They are basic and also covering non-Java files. You could use this tool for automated checks and/or a Java formatter which would be more involved.

@jakub-bochenski
Copy link

@darxriggs I took a look at the site you linked, but I don't see how would I make it work for a cloud github repo like this one.
I can't just login to Github server and pip install pre-commit there.

@jakub-bochenski
Copy link

.. or maybe I just got it wrong.
If those are only client-side hooks they don't seem to be useful here. I don't want to have to manually run checks on every PR or rely on contributors to remember to run them.
AFAIK there is no way to automate client-side hooks in Git for security reasons

@darxriggs
Copy link
Author

The main purpose of these hooks is for local use. Fortunately the pre-commit framework can also be used on CI systems - see https://pre-commit.com/#usage-in-continuous-integration.

@jakub-bochenski
Copy link

jakub-bochenski commented Aug 7, 2019

@darxriggs I tried to add pre-commit to the Jenkinsfile (#89). Right now it fails on git, even tough git is available.
Any idea how to make it work with the Jenkins plugin build infra?

[2019-08-07T15:01:00.835Z] + git --version
[2019-08-07T15:01:00.836Z] git version 2.17.1
...
[2019-08-07T15:01:04.961Z] + /home/jenkins/bin/pre-commit run --all-files
[2019-08-07T15:01:04.961Z] An error has occurred: FatalError: git failed. Is it installed, and are you in a Git repository directory?

@darxriggs
Copy link
Author

I left you a comment - see here.

@jakub-bochenski jakub-bochenski merged commit 3e1c46c into jenkinsci:master Aug 8, 2019
@darxriggs darxriggs deleted the improvements branch August 8, 2019 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants