Giter Site home page Giter Site logo

defoebrand / ruby_capstone_linter Goto Github PK

View Code? Open in Web Editor NEW
19.0 1.0 1.0 301 KB

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.

Home Page: https://repl.it/github/defoebrand/Ruby_Capstone_Linter

Ruby 100.00%
ruby ruby-linter ruby-capstone repl

ruby_capstone_linter's Introduction

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

ruby_capstone_linter's People

Contributors

defoebrand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ruby_capstone_linter's Issues

The Kermits-126

Awesome Project!
Implementation of rubocop linter is quite difficult but you are making it nicely.

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.