scripts/stylize.sh now by default checks if stylization is required. If so, it returns error with the list of files that need stylization, without any actual change. For example,
test@cacca454cccc:~/libROM/scripts$ ./stylize.sh astyle
Formatted algo/DMD.cpp
Formatted basisComparator.cpp
Formatted fileComparator.cpp
Formatted solutionComparator.cpp
Formatted test_DEIM.cpp
Formatted test_GNAT.cpp
Formatted test_QDEIM.cpp
Formatted test_RandomizedSVD.cpp
Formatted test_S_OPT.cpp
Formatted dmd/heat_conduction_dmdc.cpp
Files need stylization!
Please run stylization before merging the pull-request.
1. Install Artistic Style Version 3.1
2. cd scripts && ./stylize.sh -f /path/to/astyle
For actual enforcement of the stylization, use the flag -f, i.e. ./stylize.sh -f /path/to/astyle.
Previously stylize.sh checks the out-dated directory tests. Now it checks both unit_tests and regression_tests, which have not been checked so far.
NOTEastyle does not stylize everything for us as intended, and developers should keep the code nice and clean by themselves to some extent. For example, Previously the line 551 of lib/algo/DMD.cpp looks strange due to its peculiarly long line:
double* inverse_input = new double[d_phi_real_squared->numRows() *
d_phi_real_squared->numColumns() * 2];
This is currently edited this way:
const int dprs_row = d_phi_real_squared->numRows();
const int dprs_col = d_phi_real_squared->numColumns();
double* inverse_input = new double[dprs_row * dprs_col * 2];
Potentially there can be more lines that were somewhat carelessly written and might needs some manual edits. This PR does not intend to make all the fixes for this.
scripts/stylize.sh
now by default checks if stylization is required. If so, it returns error with the list of files that need stylization, without any actual change. For example,-f
, i.e../stylize.sh -f /path/to/astyle
.stylize.sh
checks the out-dated directorytests
. Now it checks bothunit_tests
andregression_tests
, which have not been checked so far.NOTE
astyle
does not stylize everything for us as intended, and developers should keep the code nice and clean by themselves to some extent. For example, Previously the line 551 oflib/algo/DMD.cpp
looks strange due to its peculiarly long line:This is currently edited this way:
Potentially there can be more lines that were somewhat carelessly written and might needs some manual edits. This PR does not intend to make all the fixes for this.