Skip to content

jazzm0/code-formatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

code-formatter

#Prerequisites

#Installation

simply execute in the root folder code-formatter

./install-code-formatter.sh
  • this creates the hooks directory in the user folder
  • copies the pre-commit hook to that folder
  • clones and builds https://github.com/google/google-java-format and copies the resulting jar into the hooks directory
  • installs js-beautify globally

#Usage

Before you commit your changes to a local repository the pre-commit hook is executed. If it's a java or javascript file it get's formatted. This way it is ensured, that only properly formatted code is commited to the remote repository, regardless of the IDE and plattform you use.

There are two additional scripts which may become handy:

  • javaformat.sh => can format all java files in one go. The only parameter to this script is the root directory containing the java files
  • jsformat.sh => does the same but only for .js files.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages