Giter Club home page Giter Club logo

ruby-capstone-project's Introduction

Contributors Forks Stargazers Issues


Logo

CSS Linter

Ruby Capstone Project --> Build your own linter

Table of Contents

About The Project

This is the Ruby Capstone Project required at the end of Ruby module in Microverse Curriculum. Specifically is a CSS Linter with the purpose to check for spacing, indentation and format errors.

Rules

Indentation

  • 2 space indentation rule

bad code:

  img {
  width: 700px;
  max-width: 100%;
}

good code:

  img {
    width: 700px;
    max-width: 100%;
  }

Line Format

  • One line checking
  • Line missing between css blocks

bad code:

p {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
}
a {
  color: #111111;
  font-size: 16px;
}

good code:

p {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
}

a {
  color: #111111;
  font-size: 16px;
}

Spacing

  • Checking for missing spacing after : or ,
  • Checking for missing spacing after { or }
  • Checking for line break after { or } and after each property declaration

bad code:

a,p{color: #111111; font-size: 16px;}
div{color: #222222; font-size: 18px;}

good code:

a {
  color: #111111;
  font-size: 16px;
}

div {
  color: #222222;
  font-size: 18px;
}

Usage

The CSS Linter does basic syntax checking, as well as applying a set of rules to the code and throws back an error if bad syntax is found. The throwback error is being printed out indicating the line and column of the specific syntax issue.

Examples

  • Wrong Indentation, expected n spaces
  • Spacing, expected single space before '{' and '('
  • Spacing, expected single space after ')' and ':' and ','
  • Line Format, Expected line break after '{' and '}' and ';'
  • Line Format, Expected one empty line after '}'

To test out CSS Linter you need to:

  • have Ruby installed on your computer
  • download or clone this repo:
    • Clone with SSH:
    [email protected]:rammazzoti2000/Ruby-capstone-project.git
    
    • Clone with HTTPS:
    https://github.com/rammazzoti2000/Ruby-capstone-project.git
    
  • Navigate to root directory of the repo and run:
$ bin/main path_to_file.css (path_to_file being the file you want to check for linters)

Screenshot

Automated Test

  • Run the command and see the output
$ bundle exec rspec

Screenshot

Built With

This project was built using these technologies.

  • Ruby
  • Rspec
  • Rubocop
  • Atom :atom:

Video Presentation

Check out full presentation here

Potential future features

  • Extend the linter to more complex syntax
  • Improve the terminal interaction
  • Make it an installable gem

Contributors

๐Ÿ‘ค Alexandru Bangau

๐Ÿค 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!

Acknowledgements

๐Ÿ“ License

This project is MIT licensed.

ruby-capstone-project's People

Contributors

imgbotapp avatar rammazzoti2000 avatar rammazzoti2001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ruby-capstone-project's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.