Git Product home page Git Product logo

git-fmt's People

Contributors

hjwylde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

purcell

git-fmt's Issues

Make the project direction more modular

Rather than having quite rigid requirements on pretty instances (e.g., tabs and maximum 100 character line length), make this tool modular in that it uses other binaries for pretty printing.

A configuration file can be used to define delegates and this tool can hook them together with a git repository by providing statuses and dry-runs.

(Thanks @purcell for the feedback!)

Add an `--operate-on` option

The --operate-on option should take a mode (tracked, index or working-tree) to alter which files it works on.

Test Travis allow failure

I'd like to test out the Travis allow failure for the --resolver lts and --resolver nightly options.

Ideally if these builds failed then I don't care, but it'd be something I'd need to fix before bumping the resolver.

Add languages to format

Some languages are going to be quite complex to format, e.g., ones with operator overloading or where method order is important.

The fact that I require comments and newlines to be maintained (#4, #9) means that most parsers and Pretty instances that are available from Hackage probably won't do. This will mean a lot of work will have to be done manually. So, to begin with I'm going to start with very simple languages - such as JSON, YAML, CSS and HTML!

Call style

Discussion on call style

I would like to avoid any config files. By default git-fmt should format all supported languages. The user may be able to override these by either specifying the languages manually (maybe via a --languages option) or excluding a language (maybe via a --exclude-language option).

Shell command

Create an initial shell command (git-fmt) that does nothing.

Print out all git files

Update the git-fmt command to print out all git files. This is an intermediary step until we actually do something with them.

Format style

Discussion on format style

I would like to leverage the format off the pretty library. From the outside, you can only control the line length, ribbon width and render mode. This is fine, but it may mean that I need custom instances of Pretty that provide sorting or other formatting styles. To determine what's needed, I'm going to try list what I would like the formatter to do.

The formatter will:

  • Sort imports and declarations.
  • Ensure a standard format for statements and expressions.
  • Limit line length to 100.

Further, the formatter must ensure:

  • Comments are maintained.
  • A (maximum of 1) line break between statements is maintained.

Editor plugins

Ideally I'd have an Emacs plugin which will run omnifmt on the current file whenever I save it, and omnifmt will use its smarts to Do The Right Thing in the context of my current project. I'll happily write such a plugin when the time comes.

Change `--patch` and `--dry-run` to `--mode`

Normal running, patch and dry run feel more like modes to me -> they each have different behaviour that don't intersect. Change the flags to be a single mode option.

As part of this, remove --list-files and make that the default for the normal mode.

Add `--verbose` option

Verbose mode should print out external commands called, full parse errors and should include the same output as --list-all.

It should also alter all output to include the log level and timestamp.

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.