Skip to content

Commit

Permalink
Add prettier to the pre-commit configuration
Browse files Browse the repository at this point in the history
Also apply prettier
  • Loading branch information
Pierre-Sassoulas committed Apr 7, 2021
1 parent 3420964 commit b6ce99b
Show file tree
Hide file tree
Showing 12 changed files with 132 additions and 111 deletions.
3 changes: 2 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Please read the [contribute doc](https://github.com/PyCQA/pylint/blob/master/doc/development_guide/contribute.rst).
Please read the
[contribute doc](https://github.com/PyCQA/pylint/blob/master/doc/development_guide/contribute.rst).
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/1_Bug_report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Bug report
about: Report a bug in pylint

---

<!--
Expand Down Expand Up @@ -36,6 +35,7 @@ module\
-->

### Current behavior

<!--
Result of `pylint a.py`:
```
Expand All @@ -45,10 +45,10 @@ Result of `pylint a.py`:

### Expected behavior


### pylint --version output

Result of `pylint --version` output:

```
```
Expand Down
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/2_Feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Feature request
about: Suggest an idea for this project

---

<!--
Expand All @@ -12,10 +11,13 @@ about: Suggest an idea for this project
-->

### Is your feature request related to a problem? Please describe

A clear and concise description of what the problem is.

### Describe the solution you'd like

A clear and concise description of what you want to happen.

### Additional context

Add any other context about the feature request here.
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/3_Question.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
name: Support question
about: Questions about pylint that are not covered in the documentation (https://pylint.pycqa.org/en/latest/)

about:
Questions about pylint that are not covered in the documentation
(https://pylint.pycqa.org/en/latest/)
---

## Question
18 changes: 10 additions & 8 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@ https://github.com/PyCQA/pylint/blob/master/doc/development_guide/contribute.rst

- [ ] Add yourself to CONTRIBUTORS if you are a new contributor.
- [ ] Add a ChangeLog entry describing what your PR does.
- [ ] If it's a new feature or an important bug fix, add a What's New entry in `doc/whatsnew/<current release.rst>`.
- [ ] If it's a new feature or an important bug fix, add a What's New entry in
`doc/whatsnew/<current release.rst>`.
- [ ] Write a good description on what the PR does.

## Description


## Type of Changes

<!-- Leave the corresponding lines for the applicable type of change: -->
| | Type |
| ------------- | ------------- |
|| :bug: Bug fix |
|| :sparkles: New feature |
|| :hammer: Refactoring |
|| :scroll: Docs |

| | Type |
| --- | ---------------------- |
|| :bug: Bug fix |
|| :sparkles: New feature |
|| :hammer: Refactoring |
|| :scroll: Docs |

## Related Issue

Expand Down
27 changes: 16 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ env:
DEFAULT_PYTHON: 3.6
PRE_COMMIT_CACHE: ~/.cache/pre-commit


jobs:
prepare-base:
name: Prepare base dependencies
Expand Down Expand Up @@ -88,7 +87,8 @@ jobs:
uses: actions/[email protected]
with:
path: venv
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
key:
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.prepare-base.outputs.python-key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -129,7 +129,8 @@ jobs:
uses: actions/[email protected]
with:
path: venv
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
key:
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.prepare-base.outputs.python-key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -202,7 +203,8 @@ jobs:
uses: actions/[email protected]
with:
path: venv
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
key:
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.prepare-tests-linux.outputs.python-key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -241,7 +243,8 @@ jobs:
uses: actions/[email protected]
with:
path: venv
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
key:
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.prepare-tests-linux.outputs.python-key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -283,7 +286,8 @@ jobs:
uses: actions/[email protected]
with:
path: venv
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
key:
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.prepare-tests-linux.outputs.python-key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand All @@ -307,11 +311,11 @@ jobs:
- name: Upload benchmark artifact
uses: actions/[email protected]
with:
name: benchmark-${{ runner.os }}-${{ matrix.python-version }}_${{
name:
benchmark-${{ runner.os }}-${{ matrix.python-version }}_${{
steps.artifact-name-suffix.outputs.datetime }}
path: .benchmarks/


prepare-tests-windows:
name: Prepare tests for Python ${{ matrix.python-version }} (Windows)
runs-on: windows-latest
Expand Down Expand Up @@ -377,7 +381,8 @@ jobs:
uses: actions/[email protected]
with:
path: venv
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
key:
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.prepare-tests-windows.outputs.python-key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand All @@ -389,7 +394,6 @@ jobs:
. venv\\Scripts\\activate
pytest --benchmark-disable tests/
prepare-tests-pypy:
name: Prepare tests for Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -451,7 +455,8 @@ jobs:
uses: actions/[email protected]
with:
path: venv
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
key:
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.prepare-tests-pypy.outputs.python-key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand Down
71 changes: 41 additions & 30 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,71 +1,77 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: trailing-whitespace
exclude: "tests/functional/t/trailing_whitespaces.py"
- id: end-of-file-fixer
- id: end-of-file-fixer
exclude: "tests/functional/m/missing/missing_final_newline.py|tests/functional/t/trailing_newlines.py"
- repo: https://github.com/asottile/setup-cfg-fmt
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.17.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/myint/autoflake
- id: setup-cfg-fmt
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
- id: autoflake
exclude: &fixtures tests/functional/|tests/input|tests/extensions/data|tests/regrtest_data/|tests/data/
args:
- --in-place
- --remove-all-unused-imports
- --expand-star-imports
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/asottile/pyupgrade
- --in-place
- --remove-all-unused-imports
- --expand-star-imports
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/asottile/pyupgrade
rev: v2.11.0
hooks:
- id: pyupgrade
- id: pyupgrade
args: [--py36-plus]
exclude: *fixtures
- repo: https://github.com/PyCQA/isort
- repo: https://github.com/PyCQA/isort
rev: 5.8.0
hooks:
- id: isort
- repo: https://github.com/ambv/black
- id: isort
- repo: https://github.com/ambv/black
rev: 20.8b1
hooks:
- id: black
args: [--safe, --quiet]
exclude: *fixtures
- repo: https://github.com/Pierre-Sassoulas/black-disable-checker/
- id: black
args: [--safe, --quiet]
exclude: *fixtures
- repo: https://github.com/Pierre-Sassoulas/black-disable-checker/
rev: 1.0.0
hooks:
- id: black-disable-checker
- repo: https://gitlab.com/pycqa/flake8
- id: black-disable-checker
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.0
hooks:
- id: flake8
- id: flake8
exclude: *fixtures
- repo: local
- repo: local
hooks:
- id: pylint
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args: ["-rn", "-sn", "--rcfile=pylintrc", "--load-plugins=pylint.extensions.docparams"]
args:
[
"-rn",
"-sn",
"--rcfile=pylintrc",
"--load-plugins=pylint.extensions.docparams",
]
# disabled plugins: pylint.extensions.mccabe
exclude: tests/functional/|tests/input|tests/extensions/data|tests/regrtest_data/|tests/data/|doc/
- id: fix-documentation
- id: fix-documentation
name: Fix documentation
entry: python3 -m script.fix_documentation
language: system
types: [text]
files: ^(ChangeLog|doc/whatsnew/\d+\.\d+\.rst)
- repo: https://github.com/pre-commit/mirrors-mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.812
hooks:
- id: mypy
- id: mypy
name: mypy
entry: mypy
language: python
Expand All @@ -74,3 +80,8 @@ repos:
require_serial: true
additional_dependencies: []
exclude: tests/functional/|tests/input|tests/extensions/data|tests/regrtest_data/|tests/data/|doc/|bin/
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.2.1
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]
12 changes: 6 additions & 6 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- id: pylint
name: pylint
entry: pylint
language: python
types: [python]
require_serial: true
- id: pylint
name: pylint
entry: pylint
language: python
types: [python]
require_serial: true
8 changes: 4 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
version: 2

sphinx:
configuration: doc/conf.py
configuration: doc/conf.py

python:
version: 3.7
install:
- requirements: doc/requirements.txt
version: 3.7
install:
- requirements: doc/requirements.txt
30 changes: 15 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
language: python
stages:
- tests-cpython
- tests-cpython
jobs:
include:
- stage: tests-cpython
python: 3.6
env: TOXENV=py36
- stage: tests-cpython
python: 3.6
env: TOXENV=py36
before_install:
- python --version
- uname -a
- lsb_release -a
- python --version
- uname -a
- lsb_release -a
install:
- pip install -U setuptools
- pip install tox
- virtualenv --version
- pip --version
- tox --version
- pip install -U setuptools
- pip install tox
- virtualenv --version
- pip --version
- tox --version
script:
- pip install .
- pip install .
after_failure:
- more .tox/log/* | cat
- more .tox/*/log/* | cat
- more .tox/log/* | cat
- more .tox/*/log/* | cat
notifications:
email:
on_success: always
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '{branch}-{build}'
version: "{branch}-{build}"
build: off

test_script:
Expand Down
Loading

0 comments on commit b6ce99b

Please sign in to comment.