-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathcode_checks.sh
executable file
·48 lines (41 loc) · 1.85 KB
/
code_checks.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Copyright 2022 Fuzz Introspector Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
set -Eeuo pipefail
set -x
# this currently fails
# echo "pep8"
# pep8 --first ./src/
# flake8 based on https://github.com/py-actions/flake8/blob/777f3c125938bc6e01d737c6306ecee8728cff24/src/index.js
echo "flake8 check post process"
(cd src/ && flake8 --ignore E125,W503,W504,W605 --max-line-length 100)
echo "flake8 check python frontend"
(cd frontends/python/ && flake8 --ignore E125,W503,W504,W605 --max-line-length 100)
echo "yapf code formatting"
(yapf -d -r ./src/fuzz_introspector/)
(yapf -d -r ./tools/auto-fuzz)
(yapf -d -r ./tools/web-fuzzing-introspection/app/webapp/)
(yapf -d ./tools/web-fuzzing-introspection/app/*.py)
# Ignore directories created when running launch_*_oss_fuzz.
(yapf -d -r ./tools/web-fuzzing-introspection/app/static/assets/db \
-e tools/web-fuzzing-introspection/app/static/assets/db/oss-fuzz-clone \
-e tools/web-fuzzing-introspection/app/static/assets/db/db-projects \
)
echo "pylint"
(cd src && pylint --recursive=y fuzz_introspector main.py || true)
echo "mypy"
(cd src && mypy --ignore-missing-imports -m main)
(cd tools/web-fuzzing-introspection && mypy --ignore-missing-imports --explicit-package-bases --exclude app/static/assets/db/oss-fuzz-clone/ .)