Skip to content

This is a CSS linter built using Ruby. It shows you where you have errors in your code but doesn't help you auto-correct it.

Notifications You must be signed in to change notification settings

Osong-Michael/Ruby-Capstone-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby-Capstone-Project

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.

Built With

  • RUBY

Prerequisites

  • Get ruby latest version installed

Install

  • Install VSCode or any code editor you like
  • Install Node JS and nmp(most recents versions)

Getting Started

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

Instructions

  • To check for errors in your css file run the code ruby bin/main.rb + path to css file you want to check

How it works

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 attribute color:, 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 selector p so it should look like this...

  • Good Code .blue, p {height: 100px}

Screenshot of code output

screenshot

Screenshot of rspec output

screenshot

Author

👤 Osong Agberndifor

🤝 Contributing

Contributions, issues and feature requests are welcome! Feel free to check the Issues page.

Acknowledgments

  • 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

Show your support

Give a ⭐️ if you like this project!

About

This is a CSS linter built using Ruby. It shows you where you have errors in your code but doesn't help you auto-correct it.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published