Skip to content

This project is a Linter for Ruby Code that detects error in the syntax and these errors are displayed in console once that you run the command.

Notifications You must be signed in to change notification settings

carlos-ssh/Capstone_Ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

This project is a Linter for Ruby Code that detects error in the syntax and these errors are displayed in console once that you run the command.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages