Skip to content

Latest commit

 

History

History
98 lines (67 loc) · 2.15 KB

README.md

File metadata and controls

98 lines (67 loc) · 2.15 KB

Ruby Capstone Project - Ruby Linter

View Code Github Issues GitHub Pull Requests

About

The main concept of this Capstone, it's building Linters for Ruby, the project provides feedback about errors or warnings in code. Built completely with Ruby following best practices maintaining good coding standards working DIY and managing the version control with Gitflow.

Getting Started:

To get a local copy of the repository please run the following commands on your terminal:

$ cd <folder>
$ git clone https://github.com/carlos-ssh/Capstone_Ruby.git

To check for errors on a file:

$ bin/main ./bugs/bug.rb

The file bug.rb will be contain errors on it, because it is just for tests.

Ruby Linter

It checks, the following errors & warnings.

  • check empty line error
  • check for trailing spaces
  • check missing/unexpected end
  • check for missing/unexpected tags i.e. '( )', '[ ]', and '{ }'
  • check for wrong indentation

Below are demonstrations of good and bad code for the above cases. I will use the pipe '|' symbol to indicate cursor position where necessary.

Testing Example:

# Good Code

class Ticket
  def initialize(venue, date)
    @venue = venue
    @date = date
  end
end

# Bad Code

class Ticket
  def initialize(venue, date)  |
    @venue = venue
    @date = date
  end
end

Built With

  • Ruby
  • Rubcop
  • RSpec for Ruby Testing
  • Love

Author

👤 Carlos Robles

🤝 Contributing

Contributions, issues and feature requests are welcome!

Show your support

Give a ⭐️ if you like this project!

Acknowledgments