Code Monkey home page Code Monkey logo

ruby-linter's Introduction

Ruby-linter

Build a CSS linter as a Ruby Capstone Project for Ruby module. The linter checks css file incase of such errors: for Extra/Unnecessary empty lines, Indentation(2 spaces)- private method, and Last Empty Line Space before bracket.

Installation

How to Set-Up

  • Install Ruby
$ ruby -v
$ gem install ruby
  • Set-Up the project locally
- $ git clone https://github.com/jebitok-dev/Ruby-linter
- $ git checkout develop
- run ```$ bundle```

How to Use the Linter

Open the folder you want to check on your terminal and type the following command! run linter on good file

$ ruby ./bin/markup.rb lib/good.css

run linter on bad file

$ ruby ./bin/markup.rb lib/bad.css

Built With

  • Ruby
  • Ruby-Rubocop
  • Github
  • RSpec for Testing

Features

In this version release, we will check the following issues:

- Extra/Unnecessary empty lines.
- Indentations (By Default and as far, for now, it will check indentations of 2).
- Last Empty Line.
- Space before bracket.

Error List & Examples

  • Space Before Bracket

    Bad Code

    1	body{
    2	  width: 101px;
    3	}

    Good Code

    1	body {
    2	  width: 101px;
    3	}
    4
  • Indentation

    Bad Code

    1	body {
    2			width: 101px;
    3	}

    or

    1	body {
    2	width: 101px;
    3	}

    Good Code

    1	body {
    2	  width: 101px;
    3	}
    4
  • Trailing Space

    Bad Code

    1	body {
    2	  width: 101px;
    3	}
    
    4	section {
    5	  height: 300px;
    6	}

    Good Code

    1	body {
    2	  width: 101px;
    3	}
    4
    5	section {
    6	  height: 300px;
    7	}
    8
  • Mising Last Line

    Bad Code

    1	body {
    2	  width: 101px;
    3	}
    4
    5	section {
    6	  height: 300px;
    7	}
    
    Good Code
    
    ```css
    1	body {
    2	  width: 101px;
    3	}
    4
    5	section {
    6	  height: 300px;
    7	}
    8

Run tests

Open the terminal and checkout the parent project folder and run:

$ rspec

Author

๐Ÿ‘ค Sharon Jebitok

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome!

How to Contribute

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

- Fork the repository
- git clone https://github.com/your_username/Ruby-linter
- git checkout develop
- git checkout -b branch name
- run ```$ bundle```
- git remote add upstream https://github.com/jebitok-dev/Ruby-linter
- git pull upstream develop
- git commit -m "commit message"
- git push -u origin HEAD

Show your support

Give a โญ๏ธ if you like this project!

Acknowledgments

๐Ÿ“ License

This project is MIT licensed.

ruby-linter's People

Contributors

jebitok-dev avatar

Stargazers

Ijay_dev avatar Hillary Kiptoo avatar

Watchers

James Cloos avatar  avatar

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.