Skip to content

Commit

Permalink
style: add prettier as a pre-commit hook (#261)
Browse files Browse the repository at this point in the history
* style: indent 2 for .md files
* style: add GitHub Actions badge
  • Loading branch information
andreoliwa committed Feb 6, 2021
1 parent c9ca5dc commit 17f4555
Show file tree
Hide file tree
Showing 10 changed files with 175 additions and 205 deletions.
2 changes: 1 addition & 1 deletion .codeclimate.yml
Expand Up @@ -9,7 +9,7 @@ checks:
threshold: 1000
method-complexity:
config:
threshold: 10 # Same as [flake8]max-complexity
threshold: 10 # Same as [flake8]max-complexity
plugins:
bandit: # https://docs.codeclimate.com/docs/bandit
enabled: true
Expand Down
2 changes: 1 addition & 1 deletion .editorconfig
Expand Up @@ -22,7 +22,7 @@ indent_size = 2
[*.py]
charset = utf-8

[*.{yml,yaml}]
[*.{yml,yaml,md}]
indent_size = 2

[Makefile]
Expand Down
29 changes: 14 additions & 15 deletions .github/ISSUE_TEMPLATE/bug-report.md
@@ -1,10 +1,9 @@
---
name: Bug report
about: Create a bug report to help us improve
title: ''
labels: 'bug'
assignees: ''

title: ""
labels: "bug"
assignees: ""
---

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

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

- `nitpick` version used:
- `nitpick` version used:

- Python version:
- Python version:

- Operating System and version:
- Operating System and version:

- Link to your project:
- Link to your project:

- Run the following commands and paste the output:
- Run the following commands and paste the output:

```shell script
which python3
python3 -V
pip freeze
cat $(which flake8)
```
```shell script
which python3
python3 -V
pip freeze
cat $(which flake8)
```

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

Expand Down
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature-request.md
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest a feature to help us improve
title: ''
labels: 'enhancement'
assignees: ''

title: ""
labels: "enhancement"
assignees: ""
---

Your feature may already be reported!
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Expand Up @@ -34,6 +34,11 @@ repos:
- id: python-no-eval
- id: python-no-log-warn
- id: rst-backticks
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.2.1
hooks:
- id: prettier
stages: [commit]
# Run nitpick with tox, because local repos don't seem to work well with https://pre-commit.ci/
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
Expand Down
4 changes: 4 additions & 0 deletions .prettierignore
@@ -0,0 +1,4 @@
# https://prettier.io/docs/en/configuration.html
index.html
_includes/*
*.min.css
19 changes: 19 additions & 0 deletions .prettierrc.toml
@@ -0,0 +1,19 @@
# https://prettier.io/docs/en/configuration.html

# https://prettier.io/docs/en/options.html#print-width
printWidth = 120

# https://prettier.io/docs/en/options.html#tab-width
tabWidth = 2

# https://prettier.io/docs/en/options.html#semicolons
semi = false

# https://prettier.io/docs/en/options.html#quotes
singleQuote = false

# https://prettier.io/docs/en/options.html#trailing-commas
trailingComma = "es5"

# https://prettier.io/docs/en/options.html#end-of-line
endOfLine = "lf"
38 changes: 19 additions & 19 deletions .travis.yml
Expand Up @@ -57,25 +57,25 @@ jobs:
- python: 3.7
- python: 3.6
# Thanks to https://github.com/cclauss/Travis-CI-Python-on-three-OSes/blob/master/.travis.yml
# TODO Build freezing on Windows, see comments on .travis/script.sh
# - name: "Python: 3.8"
# os: windows
# language: shell
# before_install:
# - choco install python
# - python -m pip install --upgrade pip
# env:
# - PATH=/c/Python38:/c/Python38/Scripts:$PATH
# - PYTHONPATH=/c/Users/travis/AppData/Local/pypoetry/Cache/virtualenvs/nitpick-py3.8/lib/site-packages
# - name: "Python: 3.7"
# os: windows
# language: shell
# before_install:
# - choco install python3 --version=3.7.4
# - python -m pip install --upgrade pip
# env:
# - PATH=/c/Python37:/c/Python37/Scripts:$PATH
# - PYTHONPATH=/c/Users/travis/AppData/Local/pypoetry/Cache/virtualenvs/nitpick-py3.7/lib/site-packages
# TODO Build freezing on Windows, see comments on .travis/script.sh
# - name: "Python: 3.8"
# os: windows
# language: shell
# before_install:
# - choco install python
# - python -m pip install --upgrade pip
# env:
# - PATH=/c/Python38:/c/Python38/Scripts:$PATH
# - PYTHONPATH=/c/Users/travis/AppData/Local/pypoetry/Cache/virtualenvs/nitpick-py3.8/lib/site-packages
# - name: "Python: 3.7"
# os: windows
# language: shell
# before_install:
# - choco install python3 --version=3.7.4
# - python -m pip install --upgrade pip
# env:
# - PATH=/c/Python37:/c/Python37/Scripts:$PATH
# - PYTHONPATH=/c/Users/travis/AppData/Local/pypoetry/Cache/virtualenvs/nitpick-py3.7/lib/site-packages
# Define the release stage that runs semantic-release
# https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/travis.md
- stage: release
Expand Down

0 comments on commit 17f4555

Please sign in to comment.