2b1da43a7d
Avoid flagging the use of "override" in a comment as a C++11 keyword by stripping the comments before checking for the keywords forbidden in this branch. This is not 100% correct and doesn't deal with multiline comments at all, but we use the latter ones rarely and it's not worth the effort to add support for them here.
97 lines
2.3 KiB
YAML
97 lines
2.3 KiB
YAML
# This workflow does some quick checks.
|
|
name: Code Checks
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 3.2
|
|
pull_request:
|
|
branches:
|
|
- 3.2
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
check-unix:
|
|
runs-on: ubuntu-20.04
|
|
name: Check Spelling
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install codespell
|
|
run: |
|
|
pip3 install --no-warn-script-location codespell==1.17.1
|
|
|
|
- name: Run codespell
|
|
run: |
|
|
CODESPELL=$HOME/.local/bin/codespell ./misc/scripts/spellcheck
|
|
|
|
|
|
check-whitespace:
|
|
runs-on: ubuntu-20.04
|
|
name: Check Whitespace
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Check for trailing whitespace and TABs
|
|
run: |
|
|
git fetch --depth=1 origin 3.2
|
|
git -c core.whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol,tab-in-indent \
|
|
diff --check origin/3.2 \
|
|
':!.gitmodules' \
|
|
':!Makefile.in' \
|
|
':!config.guess' \
|
|
':!config.sub' \
|
|
':!configure' \
|
|
':!descrip.mms' \
|
|
':!install-sh' \
|
|
':!docs/doxygen/doxygen-awesome-css/*' \
|
|
':!**/*akefile*' \
|
|
':!**/*.pbxproj' \
|
|
':!**/Info*.plist*' \
|
|
':!**/*.sln' \
|
|
':!**/*.vcproj' \
|
|
':!**/*.xpm'
|
|
|
|
|
|
check-mixed-eol:
|
|
runs-on: ubuntu-20.04
|
|
name: Check Mixed EOL
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install dos2unix
|
|
run: |
|
|
sudo apt-get install -y dos2unix
|
|
|
|
- name: Check for mixed EOL
|
|
run: |
|
|
./misc/scripts/check_mixed_eol.sh
|
|
|
|
check-cxx-style:
|
|
runs-on: ubuntu-20.04
|
|
name: Check C++ Style
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Check for C++11 keywords
|
|
run: |
|
|
git fetch --depth=1 origin 3.2
|
|
if git diff origin/3.2 \
|
|
':!.github/workflows/code_checks.yml' \
|
|
':!src/stc/scintilla/' \
|
|
| sed 's@//.*@@' \
|
|
| grep -E '(override|noexcept|nullptr[^_])'; then
|
|
echo "::error ::Please use C++98 equivalents of the C++11 keywords in this branch."
|
|
exit 1
|
|
fi
|