<commit_before># stylelint [![NPM version](http://img.shields.io/npm/v/stylelint.svg)](https://www.npmjs.org/package/stylelint) [![Travis Build Status](https://img.shields.io/travis/stylelint/stylelint/master.svg?label=unix%20build)](https://travis-ci.org/stylelint/stylelint) [![AppVeyor Build Status](https://img.shields.io/appveyor/ci/MoOx/stylelint/master.svg?label=windows%20build)](https://ci.appveyor.com/project/MoOx/stylelint) [![Join the chat at https://gitter.im/stylelint/stylelint](https://img.shields.io/badge/gitter%20-join%20chat%20%E2%9E%9E-1dce73.svg)](https://gitter.im/stylelint/stylelint)

> Modern CSS linter.

See [opened issues](https://github.com/stylelint/stylelint/issues) for status of the project.

### Installation

```console
$ npm install stylelint
```

### Usage

For now you must use the linter as a [PostCSS](https://github.com/postcss/postcss#usage) plugin directly. You can use a [postcss runner](https://github.com/postcss/postcss#usage), like `grunt`, `gulp` or `webpack`. For example, using `gulp`:

```js
gulp.task("css", function () {
  var postcss = require("gulp-postcss")
  var stylelint = require("stylelint")
  var logWarnings = require("postcss-log-warnings")
  return gulp.src("src/**/*.css")
    .pipe(postcss([
      stylelint({
        // config
      }),
      logWarnings()
    ]))
})
```

Or you can use the node API:

```js
var fs = require("fs")
var postcss = require("postcss")
var stylelint = require("stylelint")
var logWarnings = require("postcss-log-warnings")

// css to be processed
var css = fs.readFileSync("input.css", "utf8")

  postcss([
    stylelint({
      // config
    }),
    logWarnings(),
   ])
  .process(css, { from: file })
  .then()
```

#### Configuring rules

[Rules](docs/rules.md) are configured within the `rules` key of the config. Each rule can be turned off or on: 

* 0 - turn the rule off
* 2 - turn the rule on

```js
{
  "rules": {
    "rule-no-single-line": 0, // turn rule off
    "declaration-no-important": 2, // turn rule on
  }
}
```

Some rules require options. There are no default values, so each rule that requires options must be explicitly configured:

```js
{
  "rules": {
    "indentation": [2, {
      space: 2,
      block: "always",
      value: "always",
    }],
    "declaration-colon-space-before": [2, "never"],
    "number-leading-zero": [2, "always"],
  }
}
```

### Requirements
<commit_msg>Update indentation options example<commit_after># stylelint [![NPM version](http://img.shields.io/npm/v/stylelint.svg)](https://www.npmjs.org/package/stylelint) [![Travis Build Status](https://img.shields.io/travis/stylelint/stylelint/master.svg?label=unix%20build)](https://travis-ci.org/stylelint/stylelint) [![AppVeyor Build Status](https://img.shields.io/appveyor/ci/MoOx/stylelint/master.svg?label=windows%20build)](https://ci.appveyor.com/project/MoOx/stylelint) [![Join the chat at https://gitter.im/stylelint/stylelint](https://img.shields.io/badge/gitter%20-join%20chat%20%E2%9E%9E-1dce73.svg)](https://gitter.im/stylelint/stylelint)

> Modern CSS linter.

See [opened issues](https://github.com/stylelint/stylelint/issues) for status of the project.

### Installation

```console
$ npm install stylelint
```

### Usage

For now you must use the linter as a [PostCSS](https://github.com/postcss/postcss#usage) plugin directly. You can use a [postcss runner](https://github.com/postcss/postcss#usage), like `grunt`, `gulp` or `webpack`. For example, using `gulp`:

```js
gulp.task("css", function () {
  var postcss = require("gulp-postcss")
  var stylelint = require("stylelint")
  var logWarnings = require("postcss-log-warnings")
  return gulp.src("src/**/*.css")
    .pipe(postcss([
      stylelint({
        // config
      }),
      logWarnings()
    ]))
})
```

Or you can use the node API:

```js
var fs = require("fs")
var postcss = require("postcss")
var stylelint = require("stylelint")
var logWarnings = require("postcss-log-warnings")

// css to be processed
var css = fs.readFileSync("input.css", "utf8")

  postcss([
    stylelint({
      // config
    }),
    logWarnings(),
   ])
  .process(css, { from: file })
  .then()
```

#### Configuring rules

[Rules](docs/rules.md) are configured within the `rules` key of the config. Each rule can be turned off or on:

* 0 - turn the rule off
* 2 - turn the rule on

```js
{
  "rules": {
    "rule-no-single-line": 0, // turn rule off
    "declaration-no-important": 2, // turn rule on
  }
}
```

Some rules require options. There are no default values, so each rule that requires options must be explicitly configured:

```js
{
  "rules": {
    "indentation": [2, "tab", {
      except: ["value"],
    }],
    "declaration-colon-space-before": [2, "never"],
    "number-leading-zero": [2, "always"],
  }
}
```

### Requirements

{'fraction_non_alphanumeric': 0.1762380357885976, 'fraction_numerical': 0.01019558884727424, 'mean_word_length': 3.845766129032258, 'pattern_counts': {'":': 14, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 22, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '844113', 'n_tokens_mistral': 1707, 'n_tokens_neox': 1638, 'n_words': 382}