-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2170225
commit 6512f59
Showing
3 changed files
with
28 additions
and
3 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,4 @@ | ||
#!/bin/bash | ||
# Run MATLAB script before committing | ||
|
||
matlab -batch "try; run('dev/hooks/pre_commit.m'); catch e; disp(getReport(e)); exit(1); end; exit(0);" |
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,21 @@ | ||
toolsDir = fileparts(fileparts(mfilename('fullpath'))); | ||
addpath(genpath(toolsDir)) | ||
|
||
failed = string.empty; | ||
|
||
try | ||
ommtools.codespellToolbox | ||
catch | ||
failed = [failed, "codespell"]; | ||
end | ||
|
||
try | ||
%ommtools.stylecheckToolbox %todo... | ||
catch %#ok<UNRCH> | ||
failed = [failed, "stylecheck"]; | ||
end | ||
|
||
if ~isempty(failed) | ||
message = strjoin(" " + failed, newline); | ||
error('The following checks failed:\n%s', message) | ||
end |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
function codecheckToolbox() | ||
function issues = codecheckToolbox() | ||
% codecheckToolbox - Identify code issues for openMINDS_MATLAB toolbox | ||
|
||
ommtools.installMatBox("commit") | ||
projectRootDirectory = ommtools.projectdir(); | ||
|
||
matbox.tasks.codecheckToolbox(projectRootDirectory, ... | ||
"CreateBadge", true) | ||
issues = matbox.tasks.codecheckToolbox(projectRootDirectory, ... | ||
"CreateBadge", true); | ||
end |