Skip to content

Commit e879335

Browse files
committed
Added travis badge.
1 parent bde267a commit e879335

File tree

5 files changed

+23
-20
lines changed

5 files changed

+23
-20
lines changed

.README/README.md

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Canonical
22

3-
<!-- [![Travis build status](http://img.shields.io/travis/gajus/canonical/master.svg?style=flat-square)](https://travis-ci.org/gajus/canonical) -->
3+
[![Travis build status](http://img.shields.io/travis/gajus/canonical/master.svg?style=flat-square)](https://travis-ci.org/gajus/canonical)
44
[![NPM version](http://img.shields.io/npm/v/canonical.svg?style=flat-square)](https://www.npmjs.com/package/canonical)
55
[![js-canonical-style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)
66

@@ -9,15 +9,7 @@
99
Canonical code style linter and formatter for JavaScript, SCSS and CSS.
1010

1111
{"gitdown": "include", "file": "./badge.md"}
12-
13-
## Rules
14-
15-
Canonical rules are composed of the following packages:
16-
17-
* [`eslint-config-canonical`](https://github.com/gajus/eslint-config-canonical)
18-
* [`eslint-config-canonical-jsdoc`](https://github.com/gajus/eslint-config-canonical-jsdoc)
19-
* [`eslint-config-canonical-lodash`](https://github.com/gajus/eslint-config-canonical-lodash)
20-
* [`eslint-config-canonical-react`](https://github.com/gajus/eslint-config-canonical-react)
12+
{"gitdown": "include", "file": "./rules.md"}
2113

2214
## Usage
2315

.README/usage/command_line.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ When reading from stdin, it is required to provide `--linter` option. See [Comma
3737
```
3838
Options:
3939
--help Show help [boolean]
40-
--stdin Used to indicate that subject body will be read from stdin.
41-
[boolean] [default: false]
4240
--file-path Name of the file being linted with stdin (if any). Used in
4341
reporting. [string] [default: "<text>"]
44-
--linter The type of input. [required] [choices: "js", "scss"]
42+
--fix Used to automatically fix linting issues when possible. Works
43+
only when linting target is a file (does not work with stdin
44+
input). [boolean] [default: false]
45+
--linter The type of input. [choices: "js", "scss"]
46+
--stdin Used to indicate that subject body will be read from stdin.
47+
[boolean] [default: false]
4548
--output-format [choices: "json", "checkstyle", "table"] [default: "table"]
4649
```

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: node_js
22
node_js:
3-
- '5.0'
4-
- '4.0'
3+
- 5
4+
- 4
55
notifications:
66
email: false
77
sudo: false

README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<h1 id="canonical">Canonical</h1>
22

3-
<!-- [![Travis build status](http://img.shields.io/travis/gajus/canonical/master.svg?style=flat-square)](https://travis-ci.org/gajus/canonical) -->
3+
[![Travis build status](http://img.shields.io/travis/gajus/canonical/master.svg?style=flat-square)](https://travis-ci.org/gajus/canonical)
44
[![NPM version](http://img.shields.io/npm/v/canonical.svg?style=flat-square)](https://www.npmjs.com/package/canonical)
55
[![js-canonical-style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)
66

@@ -25,7 +25,6 @@ Use this in one of your projects? Include one of these badges in your README to
2525
[![js-canonical-style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)
2626
```
2727

28-
2928
<h2 id="canonical-rules">Rules</h2>
3029

3130
Canonical rules are composed of the following packages:
@@ -35,6 +34,7 @@ Canonical rules are composed of the following packages:
3534
* [`eslint-config-canonical-lodash`](https://github.com/gajus/eslint-config-canonical-lodash)
3635
* [`eslint-config-canonical-react`](https://github.com/gajus/eslint-config-canonical-react)
3736

37+
3838
<h2 id="canonical-usage">Usage</h2>
3939

4040
<h3 id="canonical-usage-command-line">Command Line</h3>
@@ -76,11 +76,14 @@ When reading from stdin, it is required to provide `--linter` option. See [Comma
7676
```
7777
Options:
7878
--help Show help [boolean]
79-
--stdin Used to indicate that subject body will be read from stdin.
80-
[boolean] [default: false]
8179
--file-path Name of the file being linted with stdin (if any). Used in
8280
reporting. [string] [default: "<text>"]
83-
--linter The type of input. [required] [choices: "js", "scss"]
81+
--fix Used to automatically fix linting issues when possible. Works
82+
only when linting target is a file (does not work with stdin
83+
input). [boolean] [default: false]
84+
--linter The type of input. [choices: "js", "scss"]
85+
--stdin Used to indicate that subject body will be read from stdin.
86+
[boolean] [default: false]
8487
--output-format [choices: "json", "checkstyle", "table"] [default: "table"]
8588
```
8689

src/bin/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ yargs
4545
describe: 'Name of the file being linted with stdin (if any). Used in reporting.',
4646
type: 'string'
4747
},
48+
fix: {
49+
default: false,
50+
describe: 'Used to automatically fix linting issues when possible. Works only when linting target is a file (does not work with stdin input).',
51+
type: 'boolean'
52+
},
4853
linter: {
4954
// @todo This need to be true when using stdin.
5055
choices: [

0 commit comments

Comments
 (0)