Skip to content

This app can be used to lint any .rb file and displays a message for eight different checked errors. This project can be used either online at repl.it or downloaded and used locally. It was the Ruby Capstone project for the Microverse course work.

Notifications You must be signed in to change notification settings

defoebrand/Ruby_Capstone_Linter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby Capstone Project (Ruby Linter)

This is Brandon's Ruby Capstone project

This project was compiled by Brandon in the Ruby section of the Microverse course work as the Ruby capstone project. It involved building a linter from scratch to create a real-world-like project.

This linter performs the following tests:

Trailing Whitespace:

Trailing Whitespace

Excess Whitespace:

Excess Whitespace

Empty Lines:

Empty Lines

Missing Empty Line:

Missing Empty Line

Indentation Errors:

Indentation Errors

Missing Closing Statement:

Missing Closing Statement

Missing Final Closing Statement:

Missing Final Closing Statement

Incorrect Capitalization of Reserved Word:

Incorrect Capitalization of Reserved Word

Missing Matching Bracket:

Missing Matching Bracket

Particularly noteworthy is the active error correction for when one error comes up because of the existence of another, as in the case of lines 18 and 19 where it appears as two empty lines. With error correction it registers a missing closing statement and what should be an empty line once that closing statement is added, without error correction it would register as two extraneous empty lines and a missing closing statement.

Built With

  • Ruby
  • Atom
  • Ubuntu
  • Rubocop

Prerequisities

To get this project up and running locally, you must already have ruby installed on your computer.

Getting Started

To get your own copy of this project simply clone the repository to your local machine. For instructions on how to run this linter live, skip to the Repl.It instructions below and then click on the Repl.It badge.

Step 1: Type the following command into a git shell

git clone https://github.com/defoebrand/Ruby_Capstone_Linter.git

Step 2: Direct a terminal into the directory of the cloned repository by typing:

cd Ruby_Capstone_Linter

Step 3: To ensure all necessary dependencies are present, run the following command:

bundle install

Linting Locally

Step 1: With your terminal in the cloned directory type the following command:

ruby ./bin/ruby_linter

Step 2: When prompted, enter the relative path of any file you would like to lint. To use the bad_code that comes with this repository type:

./assets/bad_code.rb

To Lint on Repl.it

Step 1: Direct the repository to the replit-readme branch

Step 2: Click run.

Step 3: When prompted, enter the relative path of the bad_code file as described above under Linting Locally. Edit the file as you see fit and test for any errors listed in the tests outlined above. If you find any incorrect errors, please submit an issue.

Try It on Repl.It

Run on Repl.it

  • Note: Repl.It does not currently support colors so the User Experience will differ between testing online and testing locally.

To Test with Rspec

Step 1: Direct a local terminal to the cloned repository.

Step 2: Enter the following command:

rspec ./spec/linter_tester.rb

Author

👤 Brandon Defoe

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

📝 License

This project is licensed by Microverse and Notion.so

About

This app can be used to lint any .rb file and displays a message for eight different checked errors. This project can be used either online at repl.it or downloaded and used locally. It was the Ruby Capstone project for the Microverse course work.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages