Git Product home page Git Product logo

hfmt's Introduction

hfmt

Hackage license Build Status

hfmt is a tool for formatting Haskell programs. Currently it is simply a gofmt style wrapper of the excellent tools hlint, hindent, and stylish-haskell.

Installation

with stack

$ stack install hfmt

with cabal

$ cabal install hfmt

Usage

Check all Haskell source under the current directory:

hfmt

Overwrite files with formatting suggestions:

hfmt -w

Help text

λ hfmt --help
hfmt - format Haskell programs

Usage: hfmt [-d|--print-diffs] [FILE]
  Reformats Haskell source files by applying HLint, hindent, and
  stylish-haskell.

Available options:
  -h,--help                Show this help text
  -d,--print-diffs         If a file's formatting is different, print a diff.
  -s,--print-sources       If a file's formatting is different, print its
                          source.
  -l,--print-paths         If a file's formatting is different, print its path.
  -w,--write-sources       If a file's formatting is different, overwrite it.
  FILE                     Explicit paths to process.
                            - A single '-' will process standard input.
                            - Files will be processed directly.
                            - Directories will be recursively searched for source files to process.
                            - .cabal files will be parsed and all specified source directories and files processed.
                            - If no paths are given, the current directory will be searched for .cabal files to process, if none are found the current directory will be recursively searched for source files to process.

Exit Codes:
  0 = No error
  1 = Encountered I/O or other operational error
  2 = Failed to parse a source code file
  3 = Source code was parsed but cannot be formatted properly
  4 = Formatted code differs from existing source (--print-diffs only)

hfmt's People

Contributors

danstiner avatar andybalaam avatar camerondiver avatar considerate avatar ynishi 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.