The aim of this project is putting the student in a real-life situation where they are given a real-world-like project with specifications and a time duration to convert those specifications into a functional product. For my project, I was asked to build a linter with Ruby and I decided to build a linter for CSS files that checks for line spacing errors in your code.
- RUBY
- Get ruby latest version installed
- Install VSCode or any code editor you like
- Install Node JS and nmp(most recents versions)
To get a local copy up and running follow these simple example steps.
- Open a terminal or command prompt interface on your machine
- Clone the project unto your local machine:
git clone https://github.com/OA7/Ruby-Capstone-Project.git
- From your terminal enter the project directory using
cd Ruby-Capstone-Project
- To check for errors in your css file run the code
ruby bin/main.rb + path to css file you want to check
The linter scans through the css file and returns an error with the line number of where that error occurered. This linter checks for line spacing errors and indentation errors. The errors this linter checks for are errors like the following below:
-
Bad Code
.blue{color: blue}
this will result in an error because the linter is expecting a space after the selector.blue
, so it should look like this... -
Good Code
.blue {color: blue}
-
Bad Code
.blue {color:blue}
this will result in an error because the linter is expecting a space after the attributecolor:
, so it should look like this... -
Good Code
.blue {color: blue}
-
Bad Code
.blue,p {height: 100px}
this will result in an error because the linter is expecting a space after the selector.blue
before the next selectorp
so it should look like this... -
Good Code
.blue, p {height: 100px}
👤 Osong Agberndifor
- Github: @githubhandle
- Twitter: @twitterhandle
- Linkedin: linkedin
Contributions, issues and feature requests are welcome! Feel free to check the Issues page.
- Hat tip to Microverse
- My stand-up team members for helping me out with ideas on how to go about this project
- Manezeu Patricia for taking time out to walk me through the processes required to come up with my own linter
Give a ⭐️ if you like this project!