-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
48 changed files
with
188 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[codespell] | ||
check-filenames = | ||
check-hidden = | ||
# Disable warnings about binary files | ||
quiet-level = 2 | ||
skip = */.git,*/common_tools/cloc,*/TriBITSDoc,*/tribits/doc/guides/rst2latex.tex | ||
ignore-words-list = thur,inout,te,nd,lod,aci,nin,nnumber,wile,reall,bu,somewhere |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: TriBITS Lint | ||
|
||
on: | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
codespell-source: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Print GitHub Actions Environment Variables | ||
run: | | ||
set | grep "^GITHUB_" | ||
- name: Update OS | ||
run: | | ||
sudo apt-get update -y | ||
- name: Install packages | ||
run: | | ||
sudo apt-get install -y codespell | ||
- name: Run Codespell on source code | ||
run: | | ||
codespell | ||
codespell-commit-messages: | ||
runs-on: ubuntu-latest | ||
|
||
if: github.event.pull_request != null | ||
|
||
steps: | ||
- name: PR commits + 1 | ||
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}" | ||
|
||
- name: Checkout PR branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: ${{ env.PR_FETCH_DEPTH }} | ||
|
||
- name: Fetch base ref | ||
run: | | ||
git fetch origin ${{ github.event.pull_request.base.sha }} | ||
- name: Print GitHub Actions Environment Variables | ||
run: | | ||
set | grep "^GITHUB_" | ||
- name: Update OS | ||
run: | | ||
sudo apt-get update -y | ||
- name: Install packages | ||
run: | | ||
sudo apt-get install -y codespell | ||
- name: Run Codespell on commit messages | ||
run: | | ||
result=0 | ||
for commit in $(git rev-list HEAD ^${{ github.event.pull_request.base.sha }}); do | ||
echo "Running codespell on commit message of $commit..." | ||
git show --format=%B -s "$commit" | codespell - || result=1 | ||
done | ||
exit $result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
which codespell >> /dev/null | ||
which_codespell_rtn=$? | ||
|
||
if [[ "${which_codespell_rtn}" == "0" ]] ; then | ||
codespell $1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
# | ||
# Run from the base TriBITS git repo clone to install local git hooks | ||
# | ||
# $ cd TriBITS/ | ||
# $ ./commont_tools/git/client-side/copy_hooks_scripts.sh | ||
# | ||
|
||
if [[ ! -d .git ]] ; then | ||
echo "Error, must be a base git repo with subdir .git/!" | ||
exit 1 | ||
fi | ||
|
||
_SCRIPT_DIR=`echo $0 | sed "s/\(.*\)\/copy_hooks_scripts.sh/\1/g"` | ||
|
||
function copy_hook_script { | ||
orig_file="$_SCRIPT_DIR/$1" | ||
dest_file=".git/hooks/$1" | ||
|
||
if diff ${orig_file} ${dest_file} &> /dev/null ; then | ||
: | ||
else | ||
echo "Copy local git hook script: $1" | ||
cp "${orig_file}" "${dest_file}" | ||
fi | ||
} | ||
|
||
#echo "_SCRIPT_DIR = '$_SCRIPT_DIR'" | ||
|
||
copy_hook_script commit-msg | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,5 @@ if (PYTHON_EXECUTABLE) | |
doc | ||
) | ||
endif() | ||
|
||
add_subdirectory(codespell) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
find_program(CODESPELL_EXEC codespell) | ||
|
||
tribits_add_advanced_test(codespell | ||
EXCLUDE_IF_NOT_TRUE CODESPELL_EXEC | ||
OVERALL_WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} | ||
SKIP_CLEAN_OVERALL_WORKING_DIRECTORY | ||
TEST_0 | ||
CMND ${CODESPELL_EXEC} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -414,7 +414,7 @@ def create_table_data(self): | |
"2019-10-17 16:32:15"]}, | ||
{"label": "Author", "align": "L", | ||
"fields": ["[email protected]", "[email protected]", | ||
"someone@somwhere.com"]}, | ||
"someone@somewhere.com"]}, | ||
{"label": "Summary", "align": "L", | ||
"fields": ["Merge Pull Request #1234 from user/repo/branch", | ||
"Fixed a Bug", "Did Some Work"]} | ||
|
@@ -431,7 +431,7 @@ def test_full_markdown_table(self): | |
"|:-------------- |:-------:|:------------------- |:---------------------- |:---------------------------------------------- |\n" \ | ||
"| MockProjectDir | e2dc488 | 2019-10-23 10:16:07 | [email protected] | Merge Pull Request #1234 from user/repo/branch |\n" \ | ||
"| ExtraRepo1 | f671414 | 2019-10-22 11:18:47 | [email protected] | Fixed a Bug |\n" \ | ||
"| ExtraRepo2 | 50bbf3e | 2019-10-17 16:32:15 | someone@somwhere.com | Did Some Work |" | ||
"| ExtraRepo2 | 50bbf3e | 2019-10-17 16:32:15 | someone@somewhere.com | Did Some Work |" | ||
self.assertEqual(table, table_expected) | ||
|
||
|
||
|
@@ -841,7 +841,7 @@ def writeGitMockProgram_dist_repo_versions_table(): | |
"MOCK_PROGRAM_OUTPUT: 2019-10-17 16:32:15\n" \ | ||
"MOCK_PROGRAM_INPUT: log -1 --pretty=format:%ae\n" \ | ||
"MOCK_PROGRAM_RETURN: 0\n" \ | ||
"MOCK_PROGRAM_OUTPUT: someone@somwhere.com\n" \ | ||
"MOCK_PROGRAM_OUTPUT: someone@somewhere.com\n" \ | ||
"MOCK_PROGRAM_INPUT: log -1 --pretty=format:%s\n" \ | ||
"MOCK_PROGRAM_RETURN: 0\n" \ | ||
"MOCK_PROGRAM_OUTPUT: Did Some Work\n" \ | ||
|
@@ -904,7 +904,7 @@ def writeGitMockProgram_dist_repo_versions_table_1_change_base(): | |
"MOCK_PROGRAM_OUTPUT: 2019-10-17 16:32:15\n" \ | ||
"MOCK_PROGRAM_INPUT: log -1 --pretty=format:%ae\n" \ | ||
"MOCK_PROGRAM_RETURN: 0\n" \ | ||
"MOCK_PROGRAM_OUTPUT: someone@somwhere.com\n" \ | ||
"MOCK_PROGRAM_OUTPUT: someone@somewhere.com\n" \ | ||
"MOCK_PROGRAM_INPUT: log -1 --pretty=format:%s\n" \ | ||
"MOCK_PROGRAM_RETURN: 0\n" \ | ||
"MOCK_PROGRAM_OUTPUT: Did Some Work\n" \ | ||
|
@@ -1730,7 +1730,7 @@ def test_dist_repo_versions_table(self): | |
"|:-------------- |:-------:|:------------------- |:---------------------- |:---------------------------------------------- |\n" \ | ||
"| MockProjectDir | e2dc488 | 2019-10-23 10:16:07 | [email protected] | Merge Pull Request #1234 from user/repo/branch |\n" \ | ||
"| ExtraRepo1 | f671414 | 2019-10-22 11:18:47 | [email protected] | Fixed a Bug |\n" \ | ||
"| ExtraRepo2 | 50bbf3e | 2019-10-17 16:32:15 | someone@somwhere.com | Did Some Work |\n" | ||
"| ExtraRepo2 | 50bbf3e | 2019-10-17 16:32:15 | someone@somewhere.com | Did Some Work |\n" | ||
self.assertEqual(s(cmndOut), s(cmndOut_expected)) | ||
|
||
finally: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.