Giter VIP home page Giter VIP logo

format's Introduction

THIS PROJECT IS NO LONGER MAINTAINED OR SUPPORTED

format

The goal of this project is to combine the formatting capabilities of various projects in the open source community into one easy-to-use command-line feature. The Eclipse IDE and The Groovy-Eclipse plugin provide effective java and groovy source code formatters respectively, so it was decided to extract those classes and add them to this project. However, this project has the potential to format an unlimited number of languages. Below are directions on how to setup and use this formatter, but also included is information on how to add more formatters to this project. Feel free to download this repository and add formatters of your own. In addition, there are instructions on how to add your own preferences to the java and groovy formatters incase you prefer different standards.

Disclaimer

This formatter has been tested on over 1000 groovy and java files. In addition, the groovy formatter has been modified so that it would cancel any formatting of source code that contained unrecognizable syntax. That being said, all software associated with this program is covered under the Apache and Eclipse Public licenses.

Installation of Software

Perform/Ensure the Following:

  1. Only a bash script has been made for this program, so if you work on a windows OS, you will need to install a bash terminal (git, cygwin, etc.).

  2. You will need a recent version of the Java runtime environment (as well as a complete JDK if you plan to modify the source code).

  3. Download this repository (you can download or clone the repo by clicking the button to the right of this page).

  4. Add the absolute path of the bin directory to your path.

  5. To make sure it was correctly installed, enter the following command in your bash shell:

	format -h

If the output is the usage of the formatter, then the software was correctly installed.

How to Use

This program works like most standard command-line formatters. To display the options, enter the same command entered in step 5 of "Installation of Software":

   format -h

As you can see, there are four options provided with the formatter: "-h" (the last command you ran), "-b", "-r", and "-g."

  • "-b" will create a backup file for the file that was ran on. However, if no changes were made to the source code after formatting took place, then a backup will not be created.
  • "-r" will format all files in the directory and subdirectories of the directory that was ran on.
  • "-g" will format all files modified in your current working directory on github.

For example, running the following command in your bash shell will format all files and provide backup files in the directory and subdirectories of the directory that was specified.

	format -r -b <path/to/directory>

Other format information

External Links

format's People

Contributors

nickjoodi avatar tgsoverly avatar joshosu99 avatar spidamikeford avatar

Watchers

James Cloos avatar foxundermoon avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.