Skip to content

Commit ed07dcd

Browse files
ChrisChris
authored andcommitted
chore: add linting and formatting
1 parent ee10d58 commit ed07dcd

File tree

3 files changed

+34
-8
lines changed

3 files changed

+34
-8
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
repos:
2-
# - repo: https://github.com/pre-commit/pre-commit-hooks
3-
# rev: v4.3.0
4-
# hooks:
5-
# - id: check-yaml
6-
# - id: end-of-file-fixer
7-
# - id: trailing-whitespace
82
- repo: https://github.com/psf/black
93
rev: 22.8.0
104
hooks:
@@ -18,5 +12,6 @@ repos:
1812
types: [python]
1913
args:
2014
[
15+
"-rn", # Only display messages
2116
"--rcfile=.pylintrc", # Link to your config file
2217
]

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Python Lint Example
2+
3+
The example project installs `pre-commit`, `black` and `pylint` to demonstrate how to apply formatting and linting to a `git` commit.
4+
5+
## Pre-requisites
6+
7+
Run ` $ pip install -r requirements.txt`
8+
9+
## pre-commit
10+
11+
Runs hooks on every commit to automatically point out issues in code.
12+
13+
Run ` $ pre-commit install` to setup the git hook scripts
14+
15+
https://pre-commit.com/
16+
17+
## black
18+
19+
Black is the uncompromising Python code formatter.
20+
21+
Run `black *.py`
22+
23+
https://pypi.org/project/black/
24+
25+
## pylint
26+
27+
Pylint is a static code analyser for Python.
28+
29+
Run `pylint *.py`
30+
31+
https://pypi.org/project/pylint/

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
requests
2-
pre-commit
3-
pylint
2+
pre - commit
43
black
4+
pylint

0 commit comments

Comments
 (0)