check-python-files.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #! /usr/bin/env sh
  2. # Copyright The Mbed TLS Contributors
  3. # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
  4. #
  5. # This file is provided under the Apache License 2.0, or the
  6. # GNU General Public License v2.0 or later.
  7. #
  8. # **********
  9. # Apache License 2.0:
  10. #
  11. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  12. # not use this file except in compliance with the License.
  13. # You may obtain a copy of the License at
  14. #
  15. # http://www.apache.org/licenses/LICENSE-2.0
  16. #
  17. # Unless required by applicable law or agreed to in writing, software
  18. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  19. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  20. # See the License for the specific language governing permissions and
  21. # limitations under the License.
  22. #
  23. # **********
  24. #
  25. # **********
  26. # GNU General Public License v2.0 or later:
  27. #
  28. # This program is free software; you can redistribute it and/or modify
  29. # it under the terms of the GNU General Public License as published by
  30. # the Free Software Foundation; either version 2 of the License, or
  31. # (at your option) any later version.
  32. #
  33. # This program is distributed in the hope that it will be useful,
  34. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  35. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  36. # GNU General Public License for more details.
  37. #
  38. # You should have received a copy of the GNU General Public License along
  39. # with this program; if not, write to the Free Software Foundation, Inc.,
  40. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  41. #
  42. # **********
  43. #
  44. # Purpose:
  45. #
  46. # Run 'pylint' on Python files for programming errors and helps enforcing
  47. # PEP8 coding standards.
  48. if type python3 >/dev/null 2>/dev/null; then
  49. PYTHON=python3
  50. else
  51. PYTHON=python
  52. fi
  53. $PYTHON -m pylint -j 2 scripts/*.py tests/scripts/*.py