@@ -48,22 +48,22 @@ jobs:
4848 run : |
4949 n=0
5050 for f in $(find . -type f -not -wholename '*/.*' -a -not -wholename '*/tests/samples/*' -a -not -wholename '*/corpus/*' -a -not -wholename '*.json'); do
51- n=$(( 1 + ${n} ))
52- filetype=$(file ${f})
53- if echo "${filetype}" | grep -q '.*text.*'; then
54- echo "CHECK:'${filetype}'"
55- lastbyte=$(hexdump -v -e '/1 "%02X\n"' ${f} | tail -1)
56- echo "Last byte is '${lastbyte}'"
57- if [ "0A" != "${lastbyte}" ]; then
58- echo "File ${f} has inappropriate line ending"
59- tail -1 ${f} | hexdump -C
60- else
61- n=$(( ${n} - 1 ))
62- fi
51+ n=$(( 1 + ${n} ))
52+ filetype=$(file ${f})
53+ if echo "${filetype}" | grep -q '.*text.*'; then
54+ echo "CHECK:'${filetype}'"
55+ lastbyte=$(hexdump -v -e '/1 "%02X\n"' ${f} | tail -1)
56+ echo "Last byte is '${lastbyte}'"
57+ if [ "0A" != "${lastbyte}" ]; then
58+ echo "File ${f} has inappropriate line ending"
59+ tail -1 ${f} | hexdump -C
6360 else
64- echo "SKIP:'${filetype}'"
65- n=$(( ${n} - 1 ))
61+ n=$(( ${n} - 1 ))
6662 fi
63+ else
64+ echo "SKIP:'${filetype}'"
65+ n=$(( ${n} - 1 ))
66+ fi
6767 done
6868 exit ${n}
6969
@@ -128,8 +128,15 @@ jobs:
128128 cd docs
129129 pip install --requirement requirements.txt
130130 make html
131- cd source
132- python -m sphinx -T -E -b html -d _build/doctrees -D language=en . ./_html
131+ python -m sphinx -T -E -b html -d _build/doctrees -D language=en ./source/ ./_html
132+ sphinx-apidoc --force --full --ext-autodoc ../credsweeper -o source/
133+ git checkout source/conf.py source/index.rst source/credsweeper.rst
134+ if [ 0 -ne $(git ls-files -m | wc -l) ]; then
135+ git diff
136+ echo "The documentation should be updated"
137+ git checkout .
138+ exit 1
139+ fi
133140
134141 # # # flake8
135142
@@ -139,9 +146,9 @@ jobs:
139146 run : |
140147 ERRCNT=$(flake8 credsweeper --count --exit-zero --output-file=flake8.txt)
141148 if ! [ 0 -eq ${ERRCNT} ] ; then
142- echo "flake8 found '${ERRCNT}' failures:"
143- cat flake8.txt
144- exit 1
149+ echo "flake8 found '${ERRCNT}' failures:"
150+ cat flake8.txt
151+ exit 1
145152 fi
146153
147154 - name : FLAKE 8 reports
@@ -164,17 +171,17 @@ jobs:
164171 run : |
165172 crc32_int=0
166173 for f in $(find credsweeper -iregex '.*\.\(py\|json\|yaml\|txt\|onnx\)$'); do
167- file_crc32_hex=$(crc32 $f)
168- file_crc32_int=$((16#${file_crc32_hex}))
169- crc32_int=$(( ${crc32_int} ^ ${file_crc32_int} ))
170- done
174+ file_crc32_hex=$(crc32 $f)
175+ file_crc32_int=$((16#${file_crc32_hex}))
176+ crc32_int=$(( ${crc32_int} ^ ${file_crc32_int} ))
177+ done
171178 version_with_crc="$(python -m credsweeper --version | head -1) crc32:$(printf '%x' ${crc32_int})"
172179 echo "version_with_crc = '${version_with_crc}'"
173180 banner=$(python -m credsweeper --banner | head -1)
174181 echo "banner = '${banner}'"
175182 if ! [ -n "${version_with_crc}" ] && [ -n "${banner}" ] && [ "${version_with_crc}" == "${banner}" ]; then
176- echo "'${version_with_crc}' != '${banner}'"
177- exit 1
183+ echo "'${version_with_crc}' != '${banner}'"
184+ exit 1
178185 fi
179186
180187 # # # yapf
@@ -183,7 +190,7 @@ jobs:
183190 if : ${{ always() && steps.setup_credsweeper.conclusion == 'success' }}
184191 run : |
185192 for f in credsweeper tests docs experiment; do
186- yapf --style .style.yapf --recursive --in-place --parallel $f
193+ yapf --style .style.yapf --recursive --in-place --parallel $f
187194 done
188195 if [ 0 -ne $(git ls-files -m | wc -l) ]; then
189196 git diff
0 commit comments