google / google/google-java-format

Feature request - make a git-aware google-java-format-diff.py

Open
#107 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.2k
Forks
937
Avg merge
6m
Merged PRs (30d)
3

Description

google-java-format-diff.py is generic in that it takes any diff and formats it.

This is certainly useful, but it means that every user who also uses git has to write a wrapper to run "git diff" appropriately and pass in that input. This makes automating formatting in a repository a bit more work.

It would be nice if there were a more git-aware variant that took in commits and/or files directly. For example, clang-format has an official git-clang-format hook (https://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/git-clang-format) which provides very tight integration with git when running clang-format.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.