GithubHelp home page GithubHelp logo

dujota / rubyfmt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fables-tales/rubyfmt

0.0 1.0 0.0 321 KB

Ruby Autoformatter!

License: MIT License

HCL 0.20% Ruby 96.73% Makefile 0.46% Shell 1.85% Dockerfile 0.75%

rubyfmt's Introduction

Rubyfmt - 0.1, the one where it doesn't break RSpec

Rubyfmt is a Ruby autoformatter in the style of gofmt. Unlike rubocop, it is intended to only be a formatter, and not any kind of deeper analysis tool.

Rubyfmt is currently "functional" in the sense that it can execute over the entirety of rspec/rspec-core and not break any of the tests.

Rubyfmt currently just outputs valid ruby, and I haven't done much in the way of making it style things in any way that remotely mirrors what makes sense for ruby. As such isn't yet really fit for day to day usage. If you'd like to try it out though, you can check out the section below

Installation

Rubyfmt is a standalone script that only loads the standard library of Ruby, as such it is not packaged as a gem. It is intended to be in your editor's save hook and run really fast.

I suggest:

  • Download src/rubyfmt.rb to ~/bin
  • Add ~/bin to your PATH (e.g. echo "$HOME/bin:$PATH" >> ~/.bash_profile)
  • Set your editor to run rubyfmt file_name > file_name on save.

Contributing

Rubyfmt considers any file going through the formatter, and coming out the other side with changed semantics to be a bug. Please file an issue or open a pull request

At this stage things are too early for us to accept PRs that affect output styling.

I will happily accept plugins that make Rubyfmt work with your favourite editor, or improve the CLI usability.

What's coming?

The next thing I'm gonna do is make Rubyfmt self hosting, which will naturally involve me updating how it formats things in a way that I don't hate.

rubyfmt's People

Contributors

bquorning avatar georgebrock avatar kddnewton avatar searls avatar tenderlove avatar teoljungberg avatar toreriklinnerud avatar

Watchers

 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.