Now that [1] is submitted how do we proceed?For contributions, I guess everyone is expected to run the google-java-format over allchanged files. Those already doing that: could you share some details of your local setup?How do you automate?
For reviewers: does it mean that we no longer comment on nits and, in general, coding style?
This was definitely one of the goals of [1].Can we trust that everyone will apply google-java-format before pushing? I think we can not.Shall we have an automated code-style check which basically fetches the change,checks it out, runs google-java-format over changed files and if there is a diff thenvote CR-1 or V-1 or Code-Style-1?
Shall the code-style-checker upload a new PS automatically if the change wasn't properlyformatted?
--Saša[1] https://gerrit-review.googlesource.com/91444
--
To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Tue, Feb 7, 2017 at 1:07 PM, Saša Živkov <ziv...@gmail.com> wrote:Now that [1] is submitted how do we proceed?For contributions, I guess everyone is expected to run the google-java-format over allchanged files. Those already doing that: could you share some details of your local setup?How do you automate?For now I have a shell alias forgit show --diff-filter=AM --pretty="" --name-only HEAD | grep java$ | xargs google-java-format -i && git add . && git commit --amend --no-edit
that I run manually before pushing one commit.I'm still looking for a command that can reformat uncommited added/modified files in the working tree (e.g. to be used during interactive rebase).For reviewers: does it mean that we no longer comment on nits and, in general, coding style?Yes, whatever the auto-formatter does is right. You still can comment if it's different from what the auto-formatter does until we have some automatic check for this.This was definitely one of the goals of [1].Can we trust that everyone will apply google-java-format before pushing? I think we can not.Shall we have an automated code-style check which basically fetches the change,checks it out, runs google-java-format over changed files and if there is a diff thenvote CR-1 or V-1 or Code-Style-1?+1
Shall the code-style-checker upload a new PS automatically if the change wasn't properlyformatted?Not sure about this. But once we have applyable fixes, the code-style-checker can create fixes and the author can accept them from the UI.
On Tue, Feb 7, 2017 at 1:37 PM, Edwin Kempin <eke...@google.com> wrote:On Tue, Feb 7, 2017 at 1:07 PM, Saša Živkov <ziv...@gmail.com> wrote:Now that [1] is submitted how do we proceed?For contributions, I guess everyone is expected to run the google-java-format over allchanged files. Those already doing that: could you share some details of your local setup?How do you automate?For now I have a shell alias forgit show --diff-filter=AM --pretty="" --name-only HEAD | grep java$ | xargs google-java-format -i && git add . && git commit --amend --no-editThe "git add ." part of the alias will also add those files which are not yet committed (dirty or untracked)?
On Tue, Feb 7, 2017 at 2:22 PM, Saša Živkov <ziv...@gmail.com> wrote:On Tue, Feb 7, 2017 at 1:37 PM, Edwin Kempin <eke...@google.com> wrote:On Tue, Feb 7, 2017 at 1:07 PM, Saša Živkov <ziv...@gmail.com> wrote:Now that [1] is submitted how do we proceed?For contributions, I guess everyone is expected to run the google-java-format over allchanged files. Those already doing that: could you share some details of your local setup?How do you automate?For now I have a shell alias forgit show --diff-filter=AM --pretty="" --name-only HEAD | grep java$ | xargs google-java-format -i && git add . && git commit --amend --no-editThe "git add ." part of the alias will also add those files which are not yet committed (dirty or untracked)?Sure. It's just what I use right now. I'm not saying that this should become the documented best practice :)
On Tue, Feb 7, 2017 at 1:07 PM, Saša Živkov <ziv...@gmail.com> wrote:
> Now that [1] is submitted how do we proceed?
>
> For contributions, I guess everyone is expected to run the
> google-java-format over all
> changed files. Those already doing that: could you share some details of
> your local setup?
> How do you automate?
>
> For reviewers: does it mean that we no longer comment on nits and, in
> general, coding style?
> This was definitely one of the goals of [1].
> Can we trust that everyone will apply google-java-format before pushing? I
> think we can not.
> Shall we have an automated code-style check which basically fetches the
> change,
> checks it out, runs google-java-format over changed files and if there is a
> diff then
> vote CR-1 or V-1 or Code-Style-1?
it would be nice to have an automated check, but the upside of the
automated formatter is that even if an badly formatted file slips
through, it can be fixed automatically in a simple follow-up change
(similar to how people keep fixing unused imports on a regular basis.)
Now that we have GJF, formatting becomes irrelevant, so I don't think
it's a big problem if a CL has some unrelated formatting.
We could recommend using
https://github.com/google/google-java-format/blob/master/scripts/google-java-format-diff.py
which will only reformat changed lines.
> --
> --
> To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Repo and Gerrit Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to repo-discuss+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
On Tue, Feb 7, 2017 at 2:42 PM, Han-Wen Nienhuys <han...@google.com> wrote:Now that we have GJF, formatting becomes irrelevant, so I don't think
it's a big problem if a CL has some unrelated formatting.Sounds like a fundamental change in our community attitude, IMHO.How many times we told to contributors not to mix (unrelated) reformatting with the real code change?It makes git blame much less usable, makes the diff larger (as diff operates on text and not on Java syntax trees)and cherry-pick may generate unrelated conflicts.After all, the whole purpose of the monster reformatting change [1] was to have minimal diff in follow-upchanges, which require GJF. Right?Or, is it only me still having issues with unrelated reformatting?
On Tue, Feb 7, 2017 at 4:55 PM, Saša Živkov <ziv...@gmail.com> wrote:On Tue, Feb 7, 2017 at 2:42 PM, Han-Wen Nienhuys <han...@google.com> wrote:Now that we have GJF, formatting becomes irrelevant, so I don't think
it's a big problem if a CL has some unrelated formatting.Sounds like a fundamental change in our community attitude, IMHO.How many times we told to contributors not to mix (unrelated) reformatting with the real code change?It makes git blame much less usable, makes the diff larger (as diff operates on text and not on Java syntax trees)and cherry-pick may generate unrelated conflicts.After all, the whole purpose of the monster reformatting change [1] was to have minimal diff in follow-upchanges, which require GJF. Right?Or, is it only me still having issues with unrelated reformatting?No, I also think that changes shouldn't contain unrelated reformattings.
Shall we execute the java formatting check on the CI and provide a specific feedback for that?
Luca.
To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google
Groups
"Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send
an
For more options, visit https://groups.google.com/d/optout.
--
Han-Wen Nienhuys
Google Munich
han...@google.com
To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
This morning I updated dev-contributing.txt with instructions for using google-java-format. Please try them out and see if you like them.
On Tue, Feb 7, 2017 at 11:29 AM, David Ostrovsky <david.o...@gmail.com> wrote:
Am Dienstag, 7. Februar 2017 17:04:59 UTC+1 schrieb Edwin Kempin:On Tue, Feb 7, 2017 at 4:55 PM, Saša Živkov <ziv...@gmail.com> wrote:On Tue, Feb 7, 2017 at 2:42 PM, Han-Wen Nienhuys <han...@google.com> wrote:Now that we have GJF, formatting becomes irrelevant, so I don't think
it's a big problem if a CL has some unrelated formatting.Sounds like a fundamental change in our community attitude, IMHO.How many times we told to contributors not to mix (unrelated) reformatting with the real code change?It makes git blame much less usable, makes the diff larger (as diff operates on text and not on Java syntax trees)and cherry-pick may generate unrelated conflicts.After all, the whole purpose of the monster reformatting change [1] was to have minimal diff in follow-upchanges, which require GJF. Right?Or, is it only me still having issues with unrelated reformatting?No, I also think that changes shouldn't contain unrelated reformattings.+1. I will always reject such a change.This suggests that we should adapt setup_gjf.sh to also set up a wrapper for google-java-diff-format.py[1]. This tool lets you format only changed lines according to "git diff".Looks like upstream also needs a way to pass a path to gjf on the command line, that would be a very simple patch.
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
On Tue, Feb 7, 2017 at 10:15 PM, Luca Milanesio <luca.mi...@gmail.com> wrote:Shall we execute the java formatting check on the CI and provide a specific feedback for that?+1Yes, I vote for that.
This morning I updated dev-contributing.txt with instructions for using google-java-format. Please try them out and see if you like them.
On Tue, Feb 7, 2017 at 10:27 PM, 'Dave Borowitz' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:This morning I updated dev-contributing.txt with instructions for using google-java-format. Please try them out and see if you like them.Doesn't work on Mac (OSX 10.11.3) out of the box, because the readlink command on Mac doesn't support the -f option the same way as Linux:$ google-java-formatreadlink: illegal option -- fusage: readlink [-n] [file ...]Looks like installing coreutils would help [1] but then the command is named greadlink on Mac :-/Any ideas how to make script work on both Linux & Mac out of the box?
Am Mittwoch, 8. Februar 2017 10:02:18 UTC+1 schrieb zivkov:On Tue, Feb 7, 2017 at 10:27 PM, 'Dave Borowitz' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:This morning I updated dev-contributing.txt with instructions for using google-java-format. Please try them out and see if you like them.Doesn't work on Mac (OSX 10.11.3) out of the box, because the readlink command on Mac doesn't support the -f option the same way as Linux:$ google-java-formatreadlink: illegal option -- fusage: readlink [-n] [file ...]Looks like installing coreutils would help [1] but then the command is named greadlink on Mac :-/Any ideas how to make script work on both Linux & Mac out of the box?Similar issue was fixed in context of this bug: [1] with this commit in Buck: [2].
--
Now that [1] is submitted how do we proceed?
On Wed, Feb 8, 2017 at 10:23 AM, David Ostrovsky <david.o...@gmail.com> wrote:
Am Mittwoch, 8. Februar 2017 10:02:18 UTC+1 schrieb zivkov:On Tue, Feb 7, 2017 at 10:27 PM, 'Dave Borowitz' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:This morning I updated dev-contributing.txt with instructions for using google-java-format. Please try them out and see if you like them.Doesn't work on Mac (OSX 10.11.3) out of the box, because the readlink command on Mac doesn't support the -f option the same way as Linux:$ google-java-formatreadlink: illegal option -- fusage: readlink [-n] [file ...]Looks like installing coreutils would help [1] but then the command is named greadlink on Mac :-/Any ideas how to make script work on both Linux & Mac out of the box?Similar issue was fixed in context of this bug: [1] with this commit in Buck: [2].Thanks David. I will try to apply this fix today.
GerritForge CI posted comments on this change.
Patch set 4:Code-Style -1
❌ The following files need formatting:
gerrit-pgm/src/main/java/com/google/gerrit/pgm/Daemon.java
(https://gerrit-ci.gerritforge.com/job/Gerrit-codestyle/136/console)
Fixing the formatting is mandatory :-)
Kudos to DavidO for making this happen.
Luca.
To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google
Groups
"Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send
an
For more options, visit https://groups.google.com/d/optout.
--
Han-Wen Nienhuys
Google Munich
han...@google.com
To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
Thanks to DavidO, the CI is now posting proper CodeStyle feedback for every change.If your change does not need
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.