Giter Site home page Giter Site logo

rubenpazch / capstone-project-linter-parses-files Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 163 KB

SASS linter with Ruby is a command-line application built entirely with Ruby, like a developer sometimes we have some rules to follow in order to apply good practices in our code, writing good code is always good, it helps other programmers to maintain them the application, this app checks if you had written your code not using good practices and left you to know which the line and column that need to be changed in order to have a clean code, for example (Comment white space inside after, Comment white space inside before, Unexpected missing end of source newline, Expected empty line before the comment, Expected indentation of zero spaces, Expected indentation of 2 spaces).

Home Page: https://repl.it/@RubenPaz/capstone-project-linter-parses-files

Ruby 99.34% CSS 0.66%
sass ruby ruby-gem

capstone-project-linter-parses-files's Introduction

SASS Linter with Ruby

Command line application to check sintax of SCSS files


Explore this project »

View DemoReport BugGetting StartedInstallingWhats is included on this projectVideo Presentation of the projectAuthor


SASS linter with Ruby is a command-line application built entirely with Ruby, like a developer sometimes we have some good programming practices to apply in our code, writing clean code is always good, it helps other programmers to maintain the application, this app checks if you had written your code using good practices and left you know which line and column need to be changed, for example (Comment white space inside after, Comment white space inside before, Unexpected missing end of source newline, Expected empty line before the comment, Expected indentation of zero spaces, Expected indentation of 2 spaces), are features from this project..



Getting Started

This project was built using Ruby, it is a command-line application and for running on your local environment you should follow these guidelines.

The SASS 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.

Prerequisites

  • Ruby 2.6.5
  • Git
  • have Ruby installed on your computer

Setup

The project repository can be found in GitHub link or just clone the project using this command.

Using SSH 

# git clone  [email protected]:rubenpazch/capstone-project-linter-parses-files.git

Using HTTPS

# git clone  https://github.com/rubenpazch/capstone-project-linter-parses-files.git

  • Open terminal on your workspace with
cd /home/workspace/capstone-project-linter-parses-files

Install

To install Ruby please follow this tutorial:

Ruby Programming Installing Ruby

To get started with the app, clone the repo, and then install the needed gems:

# bundle install --without production

Usage

  • Navigate to root directory of the repo and run on windows:
$ ruby ./bin/main path_to_file.scss (path_to_file being the file you want to check for linters)
  • Navigate to root directory of the repo and run on ubuntu:
$ main path_to_file.scss (path_to_file being the file you want to check for linters)

Screenshot

Run tests

To run the test cases with RSpec we have to follow this steps:

installing RSpec

gem install rspec

Once that’s done, you can verify your version of RSpec with, for this project we had used the version 3.9

rspec --version

finally run for watch the results

rspec

Link to assignment

the assignment can be found here.

Built With

Concepts used on this project

  • Ruby
  • SASS
  • OOP
  • Modules

Tools used on this project

  • Stickler CI
  • Visual Studio Code-
  • Rubocop

Project structure

For this project we have the next structure.

  • bin
    • main
  • img
  • lib
    • modules
  • spec

Whats is included on this project

This project includes the next parts:

  • SASS linter validations

    • Comment white space inside after
    • Comment white space inside before
    • Unexpected missing end of source newline
    • Expected empty line before comment
    • Expected indentation of zero spaces
    • Expected indentation of 2 spaces
  • RSpec test cases

Rules

Comment white space inside after

Bad code:

/*comment */

Good code:

/* comment */

Comment white space inside before

Bad code:

/* comment*/

Good code:

/* comment */

Unexpected missing end of source newline

Bad code:

/* comment */

Good code:

/* comment */

Expected empty line before comment

Bad code:

/* comment */
/* comment */

Good code:

/* comment */

/* comment */

Expected indentation of zero spaces

Bad code:

       /* comment*/

Good code:

/* comment */

Bad code:

  .enlarge {
	font-size: 14px;

Good code:

.enlarge {
	font-size: 14px;

Bad code:

  #enlarge {
	font-size: 14px;

Good code:

#enlarge {
	font-size: 14px;

Expected indentation of 2 spaces

Bad code:

/* comment */

.enlarge {
font-size: 14px;
}

Good code:

/* comment */

.enlarge {
  font-size: 14px;
}

Video Presentation of the project

You can see the loom presentation on the next link here.

Authors

👤 Ruben Paz Chuspe

Contributing

This project was created for educational purposes as part of the Microverse web development curriculum; contributing is not accepted.

Feel free to check the issues.

Show your support

Give a ⭐️ if you like this project!

Acknowledgements

License

This project is MIT licensed.

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.