Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/murodjon000/ruby-linter
https://github.com/murodjon000/ruby-linter
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/murodjon000/ruby-linter
- Owner: Murodjon000
- Created: 2021-01-11T07:48:42.000Z (about 4 years ago)
- Default Branch: development
- Last Pushed: 2021-01-13T12:19:30.000Z (almost 4 years ago)
- Last Synced: 2024-11-09T20:15:05.386Z (2 months ago)
- Language: Ruby
- Size: 37.1 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ruby Capstone Project - Ruby Linterπ
# The Build
The custom Ruby linter currently checks/detects for the following errors/warnings.
- check for trailing spaces
- check for wrong indentation
- check for missing/unexpected tags i.e. '( )', '[ ]', and '{ }'
- check missing/unexpected end
- check empty line error> Below are demonstrations of good and bad code for the above cases. I will use the pipe '|' symbol to indicate cursor position where necessary.
## Indentation Error Check
~~~ruby
# Good Codeclass Board
def initialize(player, board)
@player = player
@board = board
end
end# Bad Code
class Board
def initialize(player, board)
@player = player
@board = board
end
end
~~~## Trailing spaces
> note where the cursor(|) is on the bad code
~~~ruby
# Good Codeclass Board
def initialize(player, board)
@player = player
@board = board
end
end# Bad Code
class Board
def initialize(player, board) |
@player = player
@board = board
end
end
~~~## Missing/Unexpected Tag
~~~ruby
# Good Codeclass Board
def initialize(player, board)
@player = player
@board = board
end
end# Bad Code
class Board
def initialize(player, board
@player = player
@board = [[board]
end
end
~~~## Missing/unexpected end
~~~ruby
# Good Codeclass Board
def initialize(player, board)
@player = player
@board = board
end
end# Bad Code
class Board
def initialize(player, board)
@player = player
@board = board
end
end
end
~~~## Empty line error
~~~ruby
# Good Codeclass Board
def initialize(player, board)
@player = player
@board = board
end
end# Bad Code
class Board
def initialize(player, board)@player = player
@board = board
end
end
~~~## Built With
- Ruby
- RSpec for Ruby Testing# Getting Started
To get a local copy of the repository please run the following commands on your terminal:
```
$ cd
``````
$ git clone https://github.com/Murodjon000/ruby-linter.git
```**To check for errors on a file:**
~~~bash
$ bin/main app.rb
~~~## How to Test
1. Clone the repo to your local folder
2. cd into the folder
3. install gems by bundle install
4. Run rspec .
5. 6 examples, 0 failures will be output.β
## Contributing
β
Contributions, issues, and feature requests are welcome!
Feel free to check the [issues page](../../issues).
β
## PrerequisitesRuby,Text editor,Github profile and Git.
## Author
π€ **Murodjon000**
- GitHub: [@Murodjon000](https://github.com/Murodjon000)
- Twitter: [@Murodjon](https://twitter.com/Murodjo91836152)
- LinkedIn: [murodjon-tursunpulatov](https://www.linkedin.com/in/murodjon-tursunpulatov-5189481b3/)## π€ 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!
## Acknowledgments
- Project inspired by [Microverse](https://www.microverse.org)