mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-08 12:45:22 -05:00
Color printing + New checker message and emphasis (#492)
* Color printing + new message and emphasis * omit requirements.txt from checks
This commit is contained in:
parent
52c9756f21
commit
7bbf951c71
4 changed files with 44 additions and 8 deletions
34
.github/scripts/common/header_checker.py
vendored
34
.github/scripts/common/header_checker.py
vendored
|
|
@ -4,6 +4,7 @@ import os, sys, re
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from difflib import unified_diff
|
from difflib import unified_diff
|
||||||
from json import load
|
from json import load
|
||||||
|
from colorama import Fore, Style
|
||||||
|
|
||||||
def dprint(msg):
|
def dprint(msg):
|
||||||
print('[DEBUG]: %s' % str(msg))
|
print('[DEBUG]: %s' % str(msg))
|
||||||
|
|
@ -96,13 +97,32 @@ class HeaderChecker:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def showHelp(self, path_config):
|
def showHelp(self, path_config):
|
||||||
print('\n\n'
|
print(Fore.YELLOW)
|
||||||
"Please fix all highlighted diffs or add exceptions to '%s' as necessary.\n"
|
print(
|
||||||
"Include your changes to '%s' in your PR. Git PR checks source this file from your PR.\n"
|
"\n\n"
|
||||||
"\n"
|
"*************************************************************************************************\n"
|
||||||
"The FreeRTOS Header Check ensures all files that contain FreeRTOS Headers are up to date\n"
|
"* FreeRTOS Header Check %s(FAILED)%s *\n"
|
||||||
"with the latest version, copyright, and licensing info."
|
"*************************************************************************************************\n"
|
||||||
"\n\n" % (path_config, path_config))
|
"* *\n"
|
||||||
|
"* %sWe do NOT require that all files contain the FreeRTOS File Header (copyright + license).%s *\n"
|
||||||
|
"* While some files in this change-set don't adhere with the FreeRTOS File Header, *\n"
|
||||||
|
"* they can be omitted from this check as needed. *\n"
|
||||||
|
"* *\n"
|
||||||
|
"* The Git PR check sources its scripts from your fork. *\n"
|
||||||
|
"* For FreeRTOS/FreeRTOS, ignored files are listed in '.github/scripts/core_checker.py' *\n"
|
||||||
|
"* For FreeRTOS/FreeRTOS-Kernel, ignored files are listed in '.github/scripts/kernel_checker.py' *\n"
|
||||||
|
"* *\n"
|
||||||
|
"* Please fix any offending files that should have the FreeRTOS header, *\n"
|
||||||
|
"* or add new files to the ignore list as needed to make the check pass. *\n"
|
||||||
|
"* *\n"
|
||||||
|
"* %sInclude the required updates to the '*_checker.py' script in your PR to make the check pass.%s *\n"
|
||||||
|
"*************************************************************************************************\n"
|
||||||
|
"\n\n"
|
||||||
|
% (Fore.RED, Fore.YELLOW,
|
||||||
|
Fore.RED, Fore.YELLOW,
|
||||||
|
Fore.RED, Fore.YELLOW)
|
||||||
|
)
|
||||||
|
print(Style.RESET_ALL)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def configArgParser():
|
def configArgParser():
|
||||||
|
|
|
||||||
14
.github/scripts/common/requirements.txt
vendored
Normal file
14
.github/scripts/common/requirements.txt
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
certifi==2020.12.5
|
||||||
|
chardet==3.0.4
|
||||||
|
colorama==0.4.4
|
||||||
|
Deprecated==1.2.10
|
||||||
|
gitdb==4.0.5
|
||||||
|
GitPython==3.1.11
|
||||||
|
idna==2.10
|
||||||
|
PyGithub==1.54
|
||||||
|
PyJWT==1.7.1
|
||||||
|
PyYAML==5.3.1
|
||||||
|
requests==2.24.0
|
||||||
|
smmap==3.0.4
|
||||||
|
urllib3==1.25.11
|
||||||
|
wrapt==1.12.1
|
||||||
3
.github/scripts/core_checker.py
vendored
3
.github/scripts/core_checker.py
vendored
|
|
@ -260,7 +260,8 @@ FREERTOS_IGNORED_PATTERNS = [
|
||||||
|
|
||||||
FREERTOS_IGNORED_FILES = [
|
FREERTOS_IGNORED_FILES = [
|
||||||
'fyi-another-way-to-ignore-file.txt',
|
'fyi-another-way-to-ignore-file.txt',
|
||||||
'mbedtls_config.h'
|
'mbedtls_config.h',
|
||||||
|
'requirements.txt'
|
||||||
]
|
]
|
||||||
|
|
||||||
FREERTOS_HEADER = [
|
FREERTOS_HEADER = [
|
||||||
|
|
|
||||||
1
.github/workflows/core-checks.yml
vendored
1
.github/workflows/core-checks.yml
vendored
|
|
@ -40,6 +40,7 @@ jobs:
|
||||||
- name: Check File Headers
|
- name: Check File Headers
|
||||||
run: |
|
run: |
|
||||||
cd inspect
|
cd inspect
|
||||||
|
pip install -r .github/scripts/common/requirements.txt
|
||||||
export PYTHONPATH=tools/.github/scripts:${PYTHONPATH}
|
export PYTHONPATH=tools/.github/scripts:${PYTHONPATH}
|
||||||
.github/scripts/core_checker.py --json ${HOME}/files_modified.json ${HOME}/files_added.json ${HOME}/files_renamed.json
|
.github/scripts/core_checker.py --json ${HOME}/files_modified.json ${HOME}/files_added.json ${HOME}/files_renamed.json
|
||||||
exit $?
|
exit $?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue