In this project I have built a linter for ruby using ruby programming language. This linter will check for style issues in your ruby code.
- Indentation
- Trailing spaces
- Blank lines
- Redundant spaces
- Maximum line length
- Final empty line
Use two spaces per indentation level
def some_method
do_something
end
def some_method
do_something
end
No space should be added at line endings.
No blank lines should be included in between codes. One blank line can be added after methods.
def some_method
do_something
end
def other_method
do_something
end
def some_method
do_something
end
No lines should contain more than 70 characters or spaces.
print 'First, and foremost - numerous studies have shown that'
print 'humans read much faster vertically and very long lines'
print 'of text impede the reading process.'
print 'First, and foremost - numerous studies have shown that humans read much faster vertically and very long lines of text impede the reading process.'
No more than one space should be included in between words.
def some_method
do_something
end
def some_method
do_something
end
A file should always end with an empty line.
class Game
some_code
end
class Game
some_code
end
- RUBY
- Clone the repo:
git clone [email protected]:ershadul1/Capstone-Ruby-Linter.git
- Change directory to the cloned directory:
cd Capstone-Ruby-Linter
- Navigate to bin directory:
cd bin
- Save your test file inside the bin folder
- Run
ruby main.rb filename.rb
to check for linter errors in your test file
- Go to this link.
- Add your code inside
bin/input.rb
file. - Press the run button.
👤 Ershadul Hakim Rayhan
- Github: @ershadul1
- Twitter: @ErshadulRayhan
- Linkedin: ErshadulRayhan
- Email: [email protected]
There are two ways of contributing to this project:
-
If you see something wrong or not working, please check the issue tracker section, if that problem you met is not in already opened issues then open the issue by clicking on
new issue
button. -
If you have a solution to that, and you are willing to work on it, follow the below steps to contribute:
- Fork this repository
- Clone it on your local computer by running
git clone [email protected]:ershadul1/Capstone-Ruby-Linter.git
Replace ershadul1 with the username you use on github - Open the cloned repository which appears as a folder on your local computer with your favorite code editor
- Create a separate branch off the master branch,
- Write your codes which fix the issue you found
- Commit and push the branch you created
- Raise a pull request, comparing your new created branch with our original master branch here
Give a ⭐️ if you like this project!
- Microverse