Skip to content

Commit

Permalink
Update pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kmagusiak committed Sep 4, 2023
1 parent 84a6c77 commit dcb0422
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ run apt-get update \
bash-completion gettext git htop less openssh-client vim
add requirements-dev.txt /tmp
run cd /tmp \
&& pip3 install --no-cache invoke -r /tmp/requirements-dev.txt jupyterlab \
&& pip3 install --no-cache -r /tmp/requirements-dev.txt jupyterlab \
&& rm -f /tmp/requirements-dev.txt

# use a single user for both running the container and devcontainer
Expand Down
6 changes: 3 additions & 3 deletions addons/template/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pre_commit() {
flake8
black --check .
isort --check-only .
lint_text
}

lint_text() {
Expand All @@ -17,8 +18,8 @@ lint_text() {
echo '... should be indented with spaces'
return 1
fi
find -name '*.xml' -type f -print0 | xargs --no-run-if-empty -0 -n1 -P5 \
python3 -c 'import xml.etree.ElementTree as ET; import sys; ET.parse(sys.argv[1])'
find -name '*.xml' -type f -print0 | xargs --no-run-if-empty -0 -n50 -P3 \
python3 -c 'import xml.etree.ElementTree as ET; import sys; _ = [ET.parse(f) for f in sys.argv[1:]]'
}

format() {
Expand All @@ -28,7 +29,6 @@ format() {

lint() {
pre_commit
lint_text
# Skipping: import-error (odoo not available in github actions)
pylint -d import-error \
$(find -name '__manifest__.py' -exec dirname '{}' ';' | sort)
Expand Down

0 comments on commit dcb0422

Please sign in to comment.