This is a CSS Linter built completely with Ruby as @microverseinc Ruby Capstone Project. This Linter scans through CSS file(s) for errors and tells you what the error(s) is/are and how to fix it/them. Rubocop was used as a code-linter alongside Gitflow to ensure I maintain good coding standards.
This CSS linter currently scans for the following errors/warnings.
- check for unexpected space before semicolon
- check for indentation
- check for trailing white space
- check for ending semicolon
- check for space before colon
- check for space after colon
Below are images of 2 .css files. One passed the tests and the other failed
Failed Test
Passed Test
- Ruby
- RSpec for Ruby Testing
To get a local copy of the repository, run the following commands on your terminal:
$ cd <folder>
$ git clone https://github.com/ElijahTobs/CSS-Linter.git
Install bundler on your system
$ gem install bundler
To test the code, run rspec
from root of the folder using terminal.
Rspec is used for the test, to install the gem file, run
$ bundle install
or you simply install the the following directly using
$ gem install rspec
$ gem install colorize
$ gem install rainbow
After you might have cloned the repo and installed the gems, be it manually or by using bundler, since the lint file is located inside the bin folder, on your terminal, you'll run bin/lint
followed by the file. Using the css file in this repo as an example:
$ bin/lint lib/pass_test.css
👤 Elijah Ayandokun
- Github: @elijahtobs
- Twitter: @elijahgr8
- Linkedin: ayandokunelijah
Contributions, issues and feature requests are welcome!
Give a ⭐️ if you like this project!
- Project inspired by Microverse