Skip to content

Commit 17f4555

Browse files
authored
style: add prettier as a pre-commit hook (#261)
* style: indent 2 for .md files * style: add GitHub Actions badge
1 parent c9ca5dc commit 17f4555

File tree

10 files changed

+175
-205
lines changed

10 files changed

+175
-205
lines changed

.codeclimate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ checks:
99
threshold: 1000
1010
method-complexity:
1111
config:
12-
threshold: 10 # Same as [flake8]max-complexity
12+
threshold: 10 # Same as [flake8]max-complexity
1313
plugins:
1414
bandit: # https://docs.codeclimate.com/docs/bandit
1515
enabled: true

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ indent_size = 2
2222
[*.py]
2323
charset = utf-8
2424

25-
[*.{yml,yaml}]
25+
[*.{yml,yaml,md}]
2626
indent_size = 2
2727

2828
[Makefile]

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Bug report
33
about: Create a bug report to help us improve
4-
title: ''
5-
labels: 'bug'
6-
assignees: ''
7-
4+
title: ""
5+
labels: "bug"
6+
assignees: ""
87
---
98

109
Your bug may already be reported!
@@ -41,22 +40,22 @@ Please search on the [issue tracker](https://github.com/andreoliwa/nitpick/issue
4140

4241
<!--- Include as many relevant details about the environment you experienced the bug in -->
4342

44-
- `nitpick` version used:
43+
- `nitpick` version used:
4544

46-
- Python version:
45+
- Python version:
4746

48-
- Operating System and version:
47+
- Operating System and version:
4948

50-
- Link to your project:
49+
- Link to your project:
5150

52-
- Run the following commands and paste the output:
51+
- Run the following commands and paste the output:
5352

54-
```shell script
55-
which python3
56-
python3 -V
57-
pip freeze
58-
cat $(which flake8)
59-
```
53+
```shell script
54+
which python3
55+
python3 -V
56+
pip freeze
57+
cat $(which flake8)
58+
```
6059

6160
For more information, see the [CONTRIBUTING](https://github.com/andreoliwa/nitpick/blob/master/CONTRIBUTING.rst) guide.
6261

.github/ISSUE_TEMPLATE/feature-request.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest a feature to help us improve
4-
title: ''
5-
labels: 'enhancement'
6-
assignees: ''
7-
4+
title: ""
5+
labels: "enhancement"
6+
assignees: ""
87
---
98

109
Your feature may already be reported!

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ repos:
3434
- id: python-no-eval
3535
- id: python-no-log-warn
3636
- id: rst-backticks
37+
- repo: https://github.com/pre-commit/mirrors-prettier
38+
rev: v2.2.1
39+
hooks:
40+
- id: prettier
41+
stages: [commit]
3742
# Run nitpick with tox, because local repos don't seem to work well with https://pre-commit.ci/
3843
- repo: https://gitlab.com/pycqa/flake8
3944
rev: 3.8.4

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# https://prettier.io/docs/en/configuration.html
2+
index.html
3+
_includes/*
4+
*.min.css

.prettierrc.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# https://prettier.io/docs/en/configuration.html
2+
3+
# https://prettier.io/docs/en/options.html#print-width
4+
printWidth = 120
5+
6+
# https://prettier.io/docs/en/options.html#tab-width
7+
tabWidth = 2
8+
9+
# https://prettier.io/docs/en/options.html#semicolons
10+
semi = false
11+
12+
# https://prettier.io/docs/en/options.html#quotes
13+
singleQuote = false
14+
15+
# https://prettier.io/docs/en/options.html#trailing-commas
16+
trailingComma = "es5"
17+
18+
# https://prettier.io/docs/en/options.html#end-of-line
19+
endOfLine = "lf"

.travis.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,25 @@ jobs:
5757
- python: 3.7
5858
- python: 3.6
5959
# Thanks to https://github.com/cclauss/Travis-CI-Python-on-three-OSes/blob/master/.travis.yml
60-
# TODO Build freezing on Windows, see comments on .travis/script.sh
61-
# - name: "Python: 3.8"
62-
# os: windows
63-
# language: shell
64-
# before_install:
65-
# - choco install python
66-
# - python -m pip install --upgrade pip
67-
# env:
68-
# - PATH=/c/Python38:/c/Python38/Scripts:$PATH
69-
# - PYTHONPATH=/c/Users/travis/AppData/Local/pypoetry/Cache/virtualenvs/nitpick-py3.8/lib/site-packages
70-
# - name: "Python: 3.7"
71-
# os: windows
72-
# language: shell
73-
# before_install:
74-
# - choco install python3 --version=3.7.4
75-
# - python -m pip install --upgrade pip
76-
# env:
77-
# - PATH=/c/Python37:/c/Python37/Scripts:$PATH
78-
# - PYTHONPATH=/c/Users/travis/AppData/Local/pypoetry/Cache/virtualenvs/nitpick-py3.7/lib/site-packages
60+
# TODO Build freezing on Windows, see comments on .travis/script.sh
61+
# - name: "Python: 3.8"
62+
# os: windows
63+
# language: shell
64+
# before_install:
65+
# - choco install python
66+
# - python -m pip install --upgrade pip
67+
# env:
68+
# - PATH=/c/Python38:/c/Python38/Scripts:$PATH
69+
# - PYTHONPATH=/c/Users/travis/AppData/Local/pypoetry/Cache/virtualenvs/nitpick-py3.8/lib/site-packages
70+
# - name: "Python: 3.7"
71+
# os: windows
72+
# language: shell
73+
# before_install:
74+
# - choco install python3 --version=3.7.4
75+
# - python -m pip install --upgrade pip
76+
# env:
77+
# - PATH=/c/Python37:/c/Python37/Scripts:$PATH
78+
# - PYTHONPATH=/c/Users/travis/AppData/Local/pypoetry/Cache/virtualenvs/nitpick-py3.7/lib/site-packages
7979
# Define the release stage that runs semantic-release
8080
# https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/travis.md
8181
- stage: release

0 commit comments

Comments
 (0)