Skip to content

Commit f7591da

Browse files
committed
feat: add support for docformatter and pydocstyle
1 parent 54103df commit f7591da

File tree

2 files changed

+58
-20
lines changed

2 files changed

+58
-20
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
## About
77

8-
This action must be used for aplication the bids:
8+
This action may be used to execute the following applications:
99

1010
- [black](https://github.com/psf/black)
1111
- [pylint](https://www.pylint.org/)
@@ -40,6 +40,8 @@ steps:
4040
use-black: false
4141
use-mypy: false
4242
use-isort: false
43+
use-docformatter: false
44+
use-pydocstyle: false
4345
extra-pylint-options: ""
4446
extra-pycodestyle-options: ""
4547
extra-flake8-options: ""
@@ -62,6 +64,10 @@ black --check $(extra-black-options) $(python-root-list)
6264
mypy $(extra-mypy-options) $(python-root-list)
6365

6466
isort $(extra-isort-options) $(python-root-list) -c --diff
67+
68+
docformatter ${python-root-list}
69+
70+
pydocstyle ${python-root-list}
6571
```
6672

6773
## Versions used

entrypoint.sh

Lines changed: 51 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,20 @@
99
# $5 - use-black
1010
# $6 - use-mypy
1111
# $7 - use-isort
12-
# $8 - extra-pylint-options
13-
# $9 - extra-pycodestyle-options
14-
# ${10} - extra-flake8-options
15-
# ${11} - extra-black-options
16-
# ${12} - extra-mypy-options
17-
# ${13} - extra-isort-options
12+
# $8 - use-docformatter
13+
# $9 - use-pydocstyle
14+
# $10 - extra-pylint-options
15+
# $11 - extra-pycodestyle-options
16+
# ${12} - extra-flake8-options
17+
# ${13} - extra-black-options
18+
# ${14} - extra-mypy-options
19+
# ${15} - extra-isort-options
1820

1921
if [ "$2" = true ] ; then
2022

21-
echo Running: pylint $8 $1
23+
echo Running: pylint ${10} $1
2224

23-
pylint $8 $1
25+
pylint ${10} $1
2426
exit_code=$?
2527

2628
if [ "$exit_code" = "0" ]; then
@@ -35,9 +37,9 @@ fi
3537

3638
if [ "$3" = true ] ; then
3739

38-
echo Running: pycodestyle $9 $1
40+
echo Running: pycodestyle ${11} $1
3941

40-
pycodestyle $9 $1
42+
pycodestyle ${11} $1
4143
exit_code=$?
4244

4345
if [ "$exit_code" = "0" ]; then
@@ -51,9 +53,9 @@ fi
5153

5254
if [ "$4" = true ] ; then
5355

54-
echo Running: flake8 ${10} $1
56+
echo Running: flake8 ${12} $1
5557

56-
flake8 ${10} $1
58+
flake8 ${12} $1
5759
exit_code=$?
5860

5961
if [ "$exit_code" = "0" ]; then
@@ -67,9 +69,9 @@ fi
6769

6870
if [ "$5" = true ] ; then
6971

70-
echo Running: black --check ${11} $1
72+
echo Running: black --check ${13} $1
7173

72-
black --check ${11} $1
74+
black --check ${13} $1
7375
exit_code=$?
7476

7577
if [ "$exit_code" = "0" ]; then
@@ -83,9 +85,9 @@ fi
8385

8486
if [ "$6" = true ] ; then
8587

86-
echo Running: mypy ${12} $1
88+
echo Running: mypy ${14} $1
8789

88-
mypy ${12} $1
90+
mypy ${14} $1
8991
exit_code=$?
9092

9193
if [ "$exit_code" = "0" ]; then
@@ -99,9 +101,9 @@ fi
99101

100102
if [ "$7" = true ] ; then
101103

102-
echo Running: isort ${13} $1 -c --diff
104+
echo Running: isort ${15} $1 -c --diff
103105

104-
isort ${13} $1 -c --diff
106+
isort ${15} $1 -c --diff
105107
exit_code=$?
106108

107109
if [ "$exit_code" = "0" ]; then
@@ -111,4 +113,34 @@ if [ "$7" = true ] ; then
111113
exit $exit_code
112114
fi
113115

114-
fi
116+
fi
117+
118+
if [ "$8" = true ] ; then
119+
120+
echo Running: docformatter $1
121+
122+
docformatter $1
123+
exit_code=$?
124+
125+
if [ "$exit_code" = "0" ]; then
126+
echo "docformetter ok"
127+
else
128+
echo "docformatter error"
129+
echo $exit_code
130+
fi
131+
fi
132+
133+
if [ "$9" = true ] ; then
134+
135+
echo Running: pydocstyle $1
136+
137+
pydocstyle $1
138+
exit_code=$?
139+
140+
if [ "$exit_code" = 0 ]; then
141+
echo "pydocstyle ok"
142+
else
143+
echo "pydocstyle error"
144+
echo $exit_code
145+
fi
146+
fi

0 commit comments

Comments
 (0)