Skip to content

This is a CSS lint tool built as a Microverse Ruby capstone project.

License

Notifications You must be signed in to change notification settings

krys2fa/css-censor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

css-censor

This is a CSS lint tool built as a Microverse Ruby capstone project.

Built With

  • Ruby (Version 2.7.0)
  • Colorize gem
  • RSpec gem
  • GitFlow

Description

This linter promotes best CSS practices by checking for:

  • Unwanted trailing spaces at the end of lines in a file.
  • Indentation of 2 spaces at the beginning of lines where necessary.
  • Empty line at the end of the file.
  • Spaces before opening curly braces.
  • Missing semi-colon at the end of lines where necessary.

Live Demo

Click here in order to see a Live Demo of this project.

Screenshots

Screenshot of linter passing with no errors

screenshot

Screenshot of linter displaying errors

screenshot

Getting Started

Prerequisites

  • Terminal/Command Prompt.
  • CSS stylesheets to run linter on.

Instructions

Setup

To get a local copy up and running follow these simple example steps.

  • Download repository files.

  • Open up a terminal session.

  • In your terminal, change directory into the css-censor/bin folder.

  • Run ln -s $PWD/censor /usr/local/bin in your terminal and then run censor + file to be checked. Eg: censor main.css.

  • If the above does not work, just run ./censor + file to be checked in your terminal. Eg: ./censor main.css.

  • Alternatively, you can quickly test this linter by running censor lib/good_test.css and/or censor lib/bad_test.css.

  • If you happen to be in the bin folder, run ./censor ../lib/good_test.css and/or ./censor ../lib/bad_test.css.

  • If all else fails, ruby bin/censor lib/good_test.css will do the trick! 😉

Good and Bad Code Examples

Good Code Example

Here is an example of good code with correct usage of syntax, spaces and indentation.

.section {
  height: 2rem;
  width: 1rem;
}
Bad Code Example

Here is an example of poorly written code with incorrect usage of syntax, spaces and indentation.

.section{
    height: 2rem
  width: 1rem;}

Author

👤 Christopher Amanor

🤝 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!

📝 License

This project is MIT licensed.

About

This is a CSS lint tool built as a Microverse Ruby capstone project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published