https://github.com/simandebvu/rubylint
A basic ruby linter that checks spacing, indentation and line formatting conforming to the best practices as per the Ruby Style Guide.
https://github.com/simandebvu/rubylint
Last synced: 12 months ago
JSON representation
A basic ruby linter that checks spacing, indentation and line formatting conforming to the best practices as per the Ruby Style Guide.
- Host: GitHub
- URL: https://github.com/simandebvu/rubylint
- Owner: simandebvu
- License: mit
- Created: 2020-06-24T15:11:04.000Z (almost 6 years ago)
- Default Branch: develop
- Last Pushed: 2021-08-20T19:42:10.000Z (almost 5 years ago)
- Last Synced: 2025-03-28T22:31:22.331Z (about 1 year ago)
- Language: Ruby
- Size: 839 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rubylint
- [Rubylint](#rubylint)
- [About RubyLint](#about-rubylint)
- [How to use](#how-to-use)
- [Rules](#rules)
- [Usage](#usage)
- [Built With](#built-with)
- [Video Presentation](#video-presentation)
- [Potential future features](#potential-future-features)
- [Contributors](#contributors)
- [:handshake: Contributing](#handshake-contributing)
- [Show your support](#show-your-support)
- [Acknowledgements](#acknowledgements)
### About RubyLint
**_Rubylint_** is a linter for Ruby Style Guide specifications, which:
- Makes Ruby Code Readable
- Checks compliance
- Delivers early feedback for Ruby Developers
- Provides best practices and advices
## How to use
1. Open the directory where the application is.
2. In bash/terminal type `ruby bin/main.rb ` as below.

## Rules
**Indentation**
* 2 space indentation rule
bad code:
```ruby
# bad - four spaces
def some_method
do_something
end
```
good code:
```ruby
# good
def some_method
do_something
end
```
**Maximum line length**
* Limit lines to 80 characters.
**Termination**
* 2 space indentation rule
bad code:
```ruby
# bad
puts 'foobar'; # superfluous semicolon
```
good code:
```ruby
# good
puts 'foobar'
```
**Two or More Empty Lines**
* Don’t use several empty lines in a row.
bad code:
```ruby
# bad - It has two empty lines.
some_method
some_method
```
good code:
```ruby
# good
some_method
some_method
```
## Usage
The **_Rubylint_** does basic syntax checking, as well as applying a set of rules to the code and throws back an error if bad syntax is found. Inspired by the ruby style guide.
The throwback error is being printed out indicating the line and column of the specific syntax issue.
**Examples**
- Spacing, not enough spacing between line items.
- Class Usage, more than one class per file.
- Line Format, unnecessary charater **';'**
- Line length error, recommended line length is 60.
To test out **Rubylint** you need to:
* have **Ruby** installed on your computer
* [download](https://github.com/simandebvu/rubylint/archive/develop.zip) or clone this repo:
- Clone with SSH:
```
git@github.com:simandebvu/rubylint.git
```
- Clone with HTTPS:
```
https://github.com/simandebvu/rubylint.git
```
* Navigate to root directory of the repo and run:
```
$ ruby bin/main path_to_file.rb (path_to_file being the file you want to check for linters)
```

**Automated Test**
* Run the command and see the output
```
$ bundle exec rspec
```

### Built With
This project was built using these technologies.
* Ruby
* Rspec
* Rubocop
* VSCode
## Video Presentation
Check out full presentation [here]([#](https://www.loom.com/share/9053a51437b84e5ab9ba49fde4735549))
## Potential future features
- Accept more Complex Syntax
- Make it an installable gem
## Contributors
👤 **Shingirayi Mandebvu**
- LinkedIn: [simandebvu](https://www.linkedin.com/in/simandebvu/)
- GitHub: [@simandebvu](https://github.com/simandebvu)
- Twitter: [@simandebvu](https://twitter.com/simandebvu)
## :handshake: Contributing
Contributions, issues and feature requests are welcome!
Feel free to check the [issues page](https://github.com/simandebvu/rubylint/issues)
## Show your support
Give a :star: if you like this project!
## Acknowledgements
* [Microverse](https://www.microverse.org/)
* [Ruby Documentation](https://www.ruby-lang.org/en/documentation/)