Skip to content

Commit a7d6c43

Browse files
committed
Add initial version
1 parent 2e25878 commit a7d6c43

37 files changed

+1450
-0
lines changed

.bandit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
skips:
2+
- B101 # assert_used

.circleci/config.yml

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
version: 2.1
2+
3+
orbs:
4+
codecov: codecov/[email protected]
5+
gh: circleci/[email protected]
6+
7+
workflows:
8+
workflow:
9+
jobs:
10+
- checkout:
11+
name: Checkout
12+
context: Default
13+
filters:
14+
tags:
15+
only: /^v\d+\.\d+\.\d+$/
16+
- lint:
17+
name: Lint and check spelling
18+
context: Default
19+
requires:
20+
- Checkout
21+
filters:
22+
tags:
23+
only: /^v\d+\.\d+\.\d+$/
24+
- test:
25+
name: Run tests
26+
context: Default
27+
requires:
28+
- Checkout
29+
filters:
30+
tags:
31+
only: /^v\d+\.\d+\.\d+$/
32+
- build:
33+
name: Build
34+
context: Default
35+
requires:
36+
- Checkout
37+
filters:
38+
tags:
39+
only: /^v\d+\.\d+\.\d+$/
40+
- upload:
41+
name: Upload
42+
context: Default
43+
requires:
44+
- Lint and check spelling
45+
- Run tests
46+
- Build
47+
filters:
48+
branches:
49+
ignore: /.*/
50+
tags:
51+
only: /^v\d+\.\d+\.\d+$/
52+
53+
jobs:
54+
checkout:
55+
docker:
56+
- image: cimg/python:3.10
57+
steps:
58+
- checkout
59+
- persist_to_workspace:
60+
root: .
61+
paths:
62+
- .
63+
64+
lint:
65+
docker:
66+
- image: cimg/python:3.10-node
67+
steps:
68+
- attach_workspace:
69+
at: .
70+
- run:
71+
name: Install pdftotext and enchant
72+
command: |
73+
sudo apt update
74+
sudo apt install build-essential libpoppler-cpp-dev pkg-config enchant-2
75+
- run:
76+
name: Install cSpell
77+
command: sudo npm install cspell --global
78+
- run:
79+
name: Install markdownlint
80+
command: sudo npm install markdownlint-cli2 --global
81+
- run:
82+
name: Install pyright
83+
command: sudo npm install pyright --global
84+
- run:
85+
name: Upgrade pip
86+
command: pip3 install --upgrade pip
87+
- run:
88+
name: Install package and dev extras
89+
command: pip3 install ."[dev]"
90+
- run:
91+
name: Install Voight-Kampff
92+
command: pip3 install voight-kampff
93+
- run:
94+
name: Markdownlint
95+
command: vk markdownlint
96+
- run:
97+
name: Pyright
98+
command: vk pyright
99+
- run:
100+
name: Pylint
101+
command: vk pylint
102+
- run:
103+
name: Black
104+
command: vk black
105+
- run:
106+
name: Pydocstyle
107+
command: vk pydocstyle
108+
- run:
109+
name: Flake8
110+
command: vk flake8
111+
- run:
112+
name: Bandit
113+
command: vk bandit
114+
- run:
115+
name: isort
116+
command: vk isort
117+
- run:
118+
name: cSpell
119+
command: vk cspell
120+
- run:
121+
name: Pylint spelling
122+
command: vk pylint-spelling
123+
124+
test:
125+
docker:
126+
- image: cimg/python:3.10
127+
steps:
128+
- attach_workspace:
129+
at: .
130+
- run:
131+
name: Install pdftotext and enchant
132+
command: |
133+
sudo apt update
134+
sudo apt install build-essential libpoppler-cpp-dev pkg-config enchant-2
135+
- run:
136+
name: Upgrade pip
137+
command: pip3 install --upgrade pip
138+
- run:
139+
name: Install tox and coverage
140+
command: pip3 install tox coverage
141+
- run:
142+
name: Test
143+
command: tox
144+
- store_test_results:
145+
path: test-results
146+
- store_artifacts:
147+
path: test-results/html
148+
- codecov/upload:
149+
file: test-results/cov.xml
150+
151+
build:
152+
docker:
153+
- image: cimg/python:3.10
154+
steps:
155+
- attach_workspace:
156+
at: .
157+
- run:
158+
name: Upgrade pip
159+
command: pip3 install --upgrade pip
160+
- run:
161+
name: Install build
162+
command: pip install build
163+
- run:
164+
name: Substitute version
165+
command: |
166+
PACKAGE_VERSION=$(sed 's/^v//' \<<< ${CIRCLE_TAG:-0.0.0})
167+
sed -i "s/0.0.0/$PACKAGE_VERSION/" ./flake8_plus/version.py
168+
- run:
169+
name: Check version number
170+
command: python setup.py verify
171+
- run:
172+
name: Build
173+
command: |
174+
python3 -m build
175+
- persist_to_workspace:
176+
root: .
177+
paths:
178+
- .
179+
180+
upload:
181+
docker:
182+
- image: cimg/python:3.10
183+
steps:
184+
- gh/setup
185+
- attach_workspace:
186+
at: .
187+
- run:
188+
name: Upgrade pip
189+
command: pip3 install --upgrade pip
190+
- run:
191+
name: Install twine
192+
command: pip install twine
193+
- run:
194+
name: Upload
195+
command: |
196+
twine upload dist/*
197+
- run:
198+
name: Create release
199+
command: |
200+
echo Creating release
201+
gh release create ${CIRCLE_TAG} ./dist/*.gz --title ${CIRCLE_TAG} --notes "$(git log `git tag --sort=-committerdate | head -1`...`git tag --sort=-committerdate | head -2 | tail -1` --pretty=format:"%h - **%s**%n%n%b")"

.coveragerc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[run]
2+
branch = False
3+
4+
[report]
5+
omit = flake8_plus/version.py

.flake8

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[flake8]
2+
max-line-length=88
3+
ignore=
4+
E203, # whitespace before ‘:’
5+
W503, # line break before binary operator
6+
ANN101, # missing type annotation for self in method
7+
ANN102, # missing type annotation for cls in classmethod
8+
E741, # allow variable names I, O and l (but I and O still prevented by pylint)
9+
ANN401, # allow using the Any type hint
10+
E501, # Similar to Pylint line-too-long but Pylint can ignore string literals
11+
exclude=
12+
.git,
13+
__pycache__,
14+
.tox,
15+
.vscode,
16+
.eggs,
17+
build,
18+
dist,
19+
tests/case_files/**/*.py
20+
# Allow methods without return to not specify return type
21+
suppress-none-returning=True

.isort.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[settings]
2+
profile = black
3+
skip_gitignore = True

.markdownlint.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"default": true,
3+
"MD003": {
4+
"style": "atx"
5+
},
6+
"no-hard-tabs": true,
7+
"ol-prefix": {
8+
"style": "ordered"
9+
},
10+
"MD013": {
11+
"line_length": 88
12+
}
13+
}

.pydocstyle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[pydocstyle]
2+
convention=google
3+
add-select=
4+
D204, # 1 blank line required after class docstring
5+
D213, # Multi-line docstring summary should start at the second line
6+
D401 # First line should be in imperative mood
7+
add-ignore=
8+
D212, # Multi-line docstring summary should start at the first line
9+
D301 # Use r""" if any backslashes in a docstring
10+
11+
match = .*\.py

0 commit comments

Comments
 (0)