Skip to content

Commit 22af0a0

Browse files
committed
update dependencies, move tests out of django_enum #70
1 parent a40558f commit 22af0a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+3826
-10072
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,6 @@ dmypy.json
131131
.idea
132132
/poetry.lock
133133
test.db
134-
django_enum/tests/edit_tests/migrations/00*.py
134+
tests/edit_tests/migrations/00*.py
135135
benchmark.db
136136
type_check.py

check.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
set -e # Exit immediately if a command exits with a non-zero status.
2+
3+
if [ "$1" == "--no-fix" ]; then
4+
poetry run ruff format --check
5+
#poetry run ruff format --line-length 80 --check examples
6+
poetry run ruff check --select I
7+
poetry run ruff check
8+
else
9+
poetry run ruff format
10+
poetry run ruff format --line-length 80 examples
11+
poetry run ruff check --fix --select I
12+
poetry run ruff check --fix
13+
fi
14+
15+
poetry run mypy django_enum
16+
poetry run pyright
17+
poetry check
18+
poetry run pip check
19+
cd ./doc
20+
poetry run doc8 --ignore-path build --max-line-length 100 -q
21+
# check for broken links in the docs ############
22+
set +e
23+
24+
# do not run this in CI - too spurious
25+
if [ "$1" != "--no-fix" ]; then
26+
poetry run sphinx-build -b linkcheck -q -D linkcheck_timeout=5 ./source ./build > /dev/null 2>&1
27+
if [ $? -ne 0 ]; then
28+
cat ./build/output.txt | grep broken
29+
exit 1
30+
fi
31+
fi
32+
#################################################
33+
cd ..

django_enum/fields.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ def constraint_name(
711711
Get a check constraint name for the given enumeration field on the
712712
given model class. Check constraint names are limited to
713713
MAX_CONSTRAINT_NAME_LENGTH. The beginning parts of the name will be
714-
reduced to small hashes until the size of the name is under threshold.
714+
chopped off if it is too long.
715715
716716
:param model_class: The class of the Model the field is on
717717
:param field_name: The name of the field

0 commit comments

Comments
 (0)