Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenWalnut Core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
9c2cf6f8
Commit
9c2cf6f8
authored
Mar 01, 2020
by
Alexander Wiebel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] make stylecheck abort if it detects error (again)
parent
0658126e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
tools/cmake/OpenWalnutUtils.cmake
tools/cmake/OpenWalnutUtils.cmake
+3
-3
No files found.
tools/cmake/OpenWalnutUtils.cmake
View file @
9c2cf6f8
...
...
@@ -272,16 +272,16 @@ FUNCTION( SETUP_STYLECHECKER _TargetName _CheckFiles _Excludes )
SET
(
BrainLinterCommandFile_Errors
"
${
PROJECT_BINARY_DIR
}
/brainlint/brainlintcommand_errors_
${
_TargetName
}
"
)
FILE
(
WRITE
${
BrainLinterCommandFile_Errors
}
"#!/bin/bash
\n
declare BRAINLINTFILES=$(cat
${
BrainLinterListFile
}
); for B_FILE in $BRAINLINTFILES; do B_FILE=$(echo $B_FILE | tr -d '
\r
');
${
PROJECT_SOURCE_DIR
}
/../tools/style/brainlint/brainlint.py
${
STYLECHECK_OPTIONS
}
$B_FILE;done 2>&1 | grep -iv 'Total errors found: 0$' | cat"
)
SET
(
BrainLinterCommandFile_Exitcode
"
${
PROJECT_BINARY_DIR
}
/brainlint/brainlintcommand_exitcode_
${
_TargetName
}
"
)
FILE
(
WRITE
${
BrainLinterCommandFile_Exitcode
}
"#!/bin/bash
\n
declare BRAINLINTFILES=$(cat
${
BrainLinterListFile
}
); for B_FILE in $BRAINLINTFILES; do B_FILE=$(echo $B_FILE | tr -d '
\r
');
${
PROJECT_SOURCE_DIR
}
/../tools/style/brainlint/brainlint.py
${
STYLECHECK_OPTIONS
}
$B_FILE;done 2>&1| grep -
qi 'Total errors found: 0$'
"
)
FILE
(
WRITE
${
BrainLinterCommandFile_Exitcode
}
"#!/bin/bash
\n
declare BRAINLINTFILES=$(cat
${
BrainLinterListFile
}
); for B_FILE in $BRAINLINTFILES; do B_FILE=$(echo $B_FILE | tr -d '
\r
');
${
PROJECT_SOURCE_DIR
}
/../tools/style/brainlint/brainlint.py
${
STYLECHECK_OPTIONS
}
$B_FILE;done 2>&1| grep -
iv 'Total errors found: 0$'|grep -qi 'Total';! $(exit $?)
"
)
# add a new target for this lib
ADD_CUSTOM_TARGET
(
stylecheck_
${
_TargetName
}
# The following COMMAND will cause printing of the errors if there are errors
# and no ouput if no errors occured (not even the number of errors, i.e. 0)
COMMAND
${
BrainLinterCommandFile_Errors
}
COMMAND
bash
${
BrainLinterCommandFile_Errors
}
# The following COMMAND will cause will produce the exit code corresponding to
# whether there have been errors (2) or not (0).
COMMAND
${
BrainLinterCommandFile_Exitcode
}
COMMAND
bash
${
BrainLinterCommandFile_Exitcode
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
COMMENT
"Check if
${
_TargetName
}
complies to CodingStandard"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment