dosbox-staging/scripts/verify-python.sh
Patryk Obara 0a36c37328 Adjust copyright statements for 2021
- Update DOSBox Staging Team copyright span to year 2021 (DOSBox Team
  copyrights left untouched).
- Add DOSBox Staging Team copyright line to files we extensively
  modified throughout 2020 (we add our copyright lines when number of
  non-trivially modified lines gets close to 50%).
- Change "dosbox-staging team" to "DOSBox Staging Team", in line with
  updated branding.
- Change MAME license identifiers to SPDX license identifiers.
- Cleanup some excessive whitespace around copyright statements.
- Do few adjustments to include order.
- Add few missing copyright identifiers (GPL-2.0-or-later,
  LGPL-2.1-or-later, BSD-3-Clause) as appropriate for specific file.
- Move SPDX identifiers to the top in scripts for consistency with other
  source files.
- Remove old copy of GPL2 license in italian from old translations.
2021-01-01 00:12:05 +01:00

34 lines
923 B
Bash
Executable file

#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2019-2021 Patryk Obara <patryk.obara@gmail.com>
# This script exists only to easily run python static checker on all files in
# the repo. You can pass additional parameters to this script itself, e.g.:
#
# $ ./verify-python.sh --disable=<msg_ids>
#
# This script uses exclusively python3 version of pylint; most distributions
# provide it in a package pylint, but some call it pylint3 or python3-pylint.
set -e
list_python_files () {
git ls-files \
| xargs file \
| grep "Python script" \
| cut -d ':' -f 1
}
main () {
# Using "python3 -m pylint" to avoid using python2-only
# version of pylint by mistake.
python3 -m pylint --version >&2
echo "Checking files:" >&2
list_python_files >&2
local -r rc="$(git rev-parse --show-toplevel)/.pylint"
list_python_files | xargs -L 1000 python3 -m pylint --rcfile="$rc" "$@"
}
main "$@"