Skip to content

Commit f060867

Browse files
authored
Merge pull request #1739 from PeterDaveHello/add-editorconfig
[New] Add EditorConfig to help maintain part of coding style
2 parents d9dc846 + 0da6996 commit f060867

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
tab_width = 2
5+
indent_size = 2
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_style = space
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.txt]
13+
indent_size = false
14+
15+
[Makefile]
16+
indent_style = tab

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ before_install:
1919
- curl --version
2020
- wget --version
2121
install:
22-
- if [ -z "${SHELLCHECK-}" ]; then nvm install node && npm install && npm prune && npm ls urchin doctoc; fi
22+
- if [ -z "${SHELLCHECK-}" ]; then nvm install node && npm install && npm prune && npm ls urchin doctoc eclint; fi
2323
- '[ -z "$WITHOUT_CURL" ] || sudo apt-get remove curl -y'
2424
script:
2525
- if [ -n "${MAKE_RELEASE-}" ]; then export GIT_EDITOR="sed -i '1 s/^/99.99.99 make release test/'" && git fetch --unshallow --tags && echo proceed | make TAG=99.99.99 release ; fi
2626
- if [ -n "${DOCTOCCHECK-}" ]; then cp README.md README.md.orig && npm run doctoc && diff -q README.md README.md.orig ; fi
27+
- if [ -n "${ECLINT-}" ]; then npm run eclint ; fi
2728
- if [ -n "${SHELLCHECK-}" ]; then shellcheck -s bash nvm.sh && shellcheck -s sh nvm.sh && shellcheck -s dash nvm.sh && shellcheck -s ksh nvm.sh ; fi
2829
- if [ -n "${SHELLCHECK-}" ]; then shellcheck -s bash install.sh bash_completion nvm-exec ; fi
2930
- if [ -n "${SHELL-}" ] && [ -n "${TEST_SUITE}" ]; then if [ "${TEST_SUITE}" = 'installation_iojs' ]; then travis_retry make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL ; else make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL; fi; fi
@@ -39,6 +40,7 @@ env:
3940
- MAKE_RELEASE=true
4041
- DOCTOCCHECK=true
4142
- SHELLCHECK=true
43+
- ECLINT=true
4244
- SHELL=bash TEST_SUITE=install_script
4345
- SHELL=sh TEST_SUITE=fast
4446
- SHELL=dash TEST_SUITE=fast

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"test/installation/node": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=installation_node test-$shell",
1515
"test/installation/iojs": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=installation_iojs test-$shell",
1616
"test/sourcing": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=sourcing test-$shell",
17-
"doctoc": "doctoc --title='## Table of Contents' --github README.md"
17+
"doctoc": "doctoc --title='## Table of Contents' --github README.md",
18+
"eclint": "eclint check $(git ls-tree --name-only HEAD | xargs)"
1819
},
1920
"repository": {
2021
"type": "git",
@@ -34,6 +35,7 @@
3435
},
3536
"homepage": "https://github.com/creationix/nvm",
3637
"devDependencies": {
38+
"eclint": "^2.6.0",
3739
"replace": "^0.3.0",
3840
"semver": "^5.0.1",
3941
"urchin": "^0.0.5",

0 commit comments

Comments
 (0)