This commit is contained in:
Mike Cooper 2015-04-09 19:40:17 -07:00
Родитель 2d6a988e96
Коммит eed23b274b
4 изменённых файлов: 48 добавлений и 41 удалений

23
.pre-commit-config.yaml Normal file
Просмотреть файл

@ -0,0 +1,23 @@
- repo: https://github.com/pre-commit/pre-commit-hooks
sha: 15b678e9c67c42765c3d579e40672a332f4366d7
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-json
- id: check-merge-conflict
- id: check-yaml
- id: debug-statements
- id: flake8
exclude: "\
(.*migrations.*)|\
(configs/vagrant/settings_local.py)|\
(docs/.*)|\
(kitsune/settings.*)|\
(kitsune/sumo/db_strings.py)|\
(scripts/contributor_counts.py)|\
(scripts/crontab/gen-crons.py)|\
(scripts/peep.py)|\
(scripts/sprint_report.py)|\
(scripts/year_in_review.py)"
args: [--max-line-length=99]
- id: trailing-whitespace

Просмотреть файл

@ -1,5 +1,14 @@
# These requirements are helpful, but not required, for working on Kitsune.
# sha256: s6eaI9N7WgL6pVC5LLu-vrSqHXfmScPrOcGav1Ji2gQ
argparse==1.3.0
# sha256: qRNwGDrqY8h9hIfns5ntLZmnwvFLEI0nwLyK2e9ZXZo
aspy.yaml==0.2.1
# sha256: BBpgphbVmxMCbJi44fK4K39OoEm8_0SobUoCU7oeJ2g
cached-property==1.0.0
# sha256: yfS7goDAxl8gqd_IQRV_y0eUYeyuaXKoozNj52k6qRc
chief-james==1.0.0
@ -15,21 +24,33 @@ docutils==0.12
# sha256: KF6L1zDAtv374jwy0pNr_7pAHyPKsTLocixovoDW8YI
flake8==2.2.5
# sha256: Epii8bL0xKe5IczNFZ5OQvbXsPt1yGwM3s_HHwYYM_o
jsonschema==2.4.0
# sha256: WioXDkfeVZOmq_rh6VQr0sOSSsYrvk5u2WyVPANSJDo
mccabe==0.2.1
# sha256: e5YBIl0vUwZjVn0DMm8o8ipKZCPlasGBLWH9IEEmM_I
ndg-httpsclient==0.3.3
# sha256: z-plZ1KzlnhB98MAocl1ZSYBPuGfOsR9srdxNP84tQk
nodeenv==0.13.1
# sha256: ku47hrXBkhwtnawhe--JkMX4Usi8TZAYyv4PPzuBzTo
nosenicedots==0.5
# sha256: VzZ3y4X_CJJEsPma-VX3bC43RWYyYQtt7aYWcTnOFVo
pep8==1.6.1
# sha256: jnbbT3Kv6QCHxHRntYjQ3j2_hvbj7nYqok7KqmyhuwM
pre-commit==0.4.4
# sha256: P6gKELNtUWhr93RPXcmWIs1cmM6O1kAi5imGiq_Bd2k
pyflakes==0.8.1
# sha256: w2yTiocuX_SUk4szsUqqFWy0OexnVI_Ks1Nbt4sIRug
PyYAML==3.11
# sha256: a_c6l7D-RUKn7i2KYnoTs4KegdERvidVGzag36DCkJk
q==2.4
@ -38,3 +59,6 @@ Sphinx==1.2.3
# sha256: kHGqy9l6mpFQlsGq8NxoSsJnKQTNh221kECF1trJgQ4
tabulate==0.7.5
# sha256: PIjPffEUwyzwZR0S-Xm421VtmS1kdJPlvbvigovkAAc
virtualenv==12.1.1

Просмотреть файл

@ -1,40 +0,0 @@
#!/bin/bash
# This file runs a serious of lints against the code base, each of which
# has been configured to our liking. This is intended to be run as part
# of a continuous integration suite, and all new code should pass these
# tests. The currently run lint programs are:
#
# - pep8
# - pyflakes
#
# Generated code such as migrations are ignored, as are any other files
# that would be unreasonable to lint. Think carefully before adding
# a new file to the list of ignores. The list of exclusions is in
# setup.cfg
# Files to lint is either the list of arguments to this script, or the
# kitsune directory by default.
if [[ $# -eq 0 ]]; then
FILES="kitsune"
else
FILES="$@"
fi
FLAKE8_FILES=()
for f in $FILES; do
# If it is a directory, or if it is a python file, lint it with flake8.
if [[ -d $f ]] || echo $f | grep -E '.py$' > /dev/null; then
FLAKE8_FILES+=($f)
fi
done
# If there are files to run through flake8, do it.
if [[ -n ${FLAKE8_FILES[*]} ]]; then
flake8 ${FLAKE8_FILES[*]}
FLAKE_RETURN=$?
else
FLAKE_RETURN=0
fi
exit $FLAKE_RETURN

Просмотреть файл

@ -8,7 +8,7 @@ case $SUITE in
scripts/lint.sh
;;
lint )
scripts/lint.sh
pre-commit run --all-files
;;
django )
scripts/travis/test.sh