-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: add darglint to ci * ci: add test file to validate * ci: add test file to validate * ci: add pydocstyle and dummy files * ci: testing docstrings linter * ci: add test file to validate * ci: add test file to validate * ci: add test file to validate * ci: add test file to validate * ci: add test file to validate * ci: add test file to validate * ci: add test file to validate * ci: debug changed file in loop * ci: debug changed file in loop * ci: rename workflow add echo * ci: test printing all outputs * ci: testing docstring linter * ci: capture output of both * ci: remove dummy files Co-authored-by: cristian mtr <cristian.mitroi@jina.ai>
- Loading branch information
1 parent
8090dac
commit 0f6b961
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
# required in order to get the status of all the files at once | ||
pip install darglint==1.6.0 | ||
pip install pydocstyle==5.1.1 | ||
echo ==================================================================================== | ||
echo DOCSTRINGS LINT: checking $CHANGED_FILES | ||
echo ------------------------------------------------------------------------------------ | ||
echo 'removing files under /tests...' | ||
arrVar=() | ||
# we ignore tests files | ||
for changed_file in $CHANGED_FILES; do | ||
if [[ ${changed_file}} != tests/* ]]; then | ||
echo keeping ${changed_file} | ||
arrVar+=(${changed_file}) | ||
fi | ||
done | ||
DARGLINT_OUTPUT=$(darglint -v 2 -s sphinx "${arrVar[@]}"); PYDOCSTYLE_OUTPUT=$(pydocstyle --select=D101,D102,D103 "${arrVar[@]}") | ||
# status captured here | ||
if [[ -z "$PYDOCSTYLE_OUTPUT" ]] && [[ -z "$DARGLINT_OUTPUT" ]]; then | ||
echo 'OK' | ||
exit 0 | ||
else | ||
echo 'failure' | ||
echo $DARGLINT_OUTPUT | ||
echo $PYDOCSTYLE_OUTPUT | ||
exit 1 | ||
fi | ||
echo ==================================================================================== |