Giter Site home page Giter Site logo

catalinmiron / scry-css Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ovidiubute/scry-css

0.0 3.0 0.0 276 KB

Easily discover LESS/SASS variables and mixins in large scale projects.

Home Page: http://ovidiubute.github.io/scry-css/

License: MIT License

JavaScript 100.00%

scry-css's Introduction

Build Status Coverage Status

NPM

Scry-CSS

Easily discover LESS/SASS variables and mixins in large scale projects.

demo.gif

Need

As a developer
I want to find all available LESS/SASS variables & mixins in my project and dependencies without manually going through all of the project files
So that I can increase productivity and code quality
```

### What's this all about?
This tool is useful in large projects that make heavy use of LESS or SASS variables and mixins. Onboarding new members in such projects is often difficult because of lack of documentation, and this can lead to developers rewriting their own LESS/SASS variables due to insufficient knowledge of the project. This is both counterproductive and dangerous because your project may have a style guide that you wish to enforce.

Imagine a scenario where your developers just write the code that they want, and during a code review, you run `scry-css` to find out if they followed your project's style guide or not (ideally they'd run the tool themselves). This leads to a more interactive learning experience compared to the old way of forcing them to read the documentation or all of your "base" CSS files beforehand.

### How to use scry-css
```npm install -g scry-css```
```scry-css [options] <type> <directory> <files...>```

Command line options:
- ```-r```: How to report results, options are `json` or `console`, the default is `console` and will output to stdout
- ```type```: The CSS dialect used, options are `less` and `sass`
- ```directory```: Absolute path to the directory where less/sass variables/mixins are located
- ```files```: List of absolute paths to your working files, separated by spaces

### Contribute
Pull requests are very appreciated :-)

I'm using [Travis CI](https://travis-ci.org/) to build, and [Coveralls](https://coveralls.io/) for code coverage ([Istanbul](https://github.com/gotwarlost/istanbul) does the actual instrumentation).

PRs will only be accepted if they do not reduce the test coverage under 95%, regardless of how important the code is to the project.

To run the tests:

```
npm test
```

If you'd like to keep the tests running while you're working you can run:

```
npm run test:watch
```

This will also provide you a system notification whenever you change your code to let you know if the tests still pass.

ESLint is integrated into the project as a pre-commit hook (along with the unit-tests), you can't commit unless all the unit-tests pass and there are no linting errors (unless you manually force the commit, which I don't recommend).
As linting rules I'm using [airbnb](https://www.npmjs.com/package/eslint-config-airbnb) with a few twists, check out `.eslintrc.js` for the details, and just run `npm run lint` to see the results at any time.

One last note; this tool requires at least Node 6.0, there are no plans to support older versions.

### FAQ
Q: I don't get it. I use Sublime/WebStorm/Atom and I just type `@` and I get variables suggested. Why would I use your tool?

A: If you're happy with your IDE in control, then that's fine. I used to rely on my IDE for everything, too. But how does an IDE help you review somebody else's code? Do you checkout his branch locally and verify it? Are you absolutely sure your IDE suggests variables that are inside `node_modules`? This tool is IDE agnostic and can be run in a CI environment using the `json` reporter option. It is a much more flexible solution that can be expanded further (see the Github Issues tab for my vision).

Q: How are variables suggested?

A: I use the fuzzy search algorithm supplied by ***fuzzaldrin***

Q: I think the name of a variable is not enough for it to be suggested. Any plans on including the value of the variable too?

A: Yes, there are plans. Watch the [Issues](https://github.com/ovidiubute/scry-css/issues) in GitHub for more info.

## License
This project uses the [MIT](https://github.com/ovidiubute/scry-css/blob/master/LICENSE) license.

scry-css's People

Contributors

adnrs96 avatar catalinmiron avatar gaurav1911 avatar gutem avatar kamilogorek avatar ovidiubute avatar thomasvdam avatar

Watchers

 avatar  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.