Skip to content

Commit

Permalink
Merge pull request #6153 from gassmoeller/extend_indent_to_changes
Browse files Browse the repository at this point in the history
Extend indent script to fix changelog entries
  • Loading branch information
tjhei authored Jan 7, 2025
2 parents df79046 + f2be02c commit 8b5abd1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
19 changes: 14 additions & 5 deletions contrib/utilities/indent
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,17 @@ find tests include source benchmarks cookbooks unit_tests \
| xargs -P 10 -I {} bash -c "indent_file {}"


# Find all source files that should be checked for invalid characters
# and other unwanted formatting options. This includes more
# files than the ones indented by astyle above (e.g. documentation source
# files). Prints all file names separated by a NULL character (\0).
find_source_files() {
find include source unit_tests cookbooks benchmarks doc \( -name '*.cc' -o -name '*.h' -o -name '*.prm' -o -name '*.h.in' -o -name 'CMakeLists.txt' -o -name '*.cmake' -o -name '*.md' -o -wholename '*modules/changes/*' \) -print0
}
export -f find_source_files

# remove execute permission on source files:
find tests include source benchmarks cookbooks unit_tests \( -name '*.cc' -o -name '*.h' -o -name '*.prm' \) -print | xargs -n 50 -P 10 chmod -x
find_source_files | xargs -0 -n 50 -P 10 chmod -x

# convert dos formatted files to unix file format by stripping out
# carriage returns (15=0x0D):
Expand All @@ -156,7 +165,7 @@ dos_to_unix()
fi
}
export -f dos_to_unix
find tests include source unit_tests cookbooks benchmarks doc \( -name '*.cc' -o -name '*.h' -o -name '*.prm' -o -name '*.h.in' -o -name '*.md' \) -print | xargs -P 10 -I {} bash -c 'dos_to_unix "$@"' _ {}
find_source_files | xargs -0 -P 10 -I {} bash -c 'dos_to_unix "$@"' _ {}

# convert tabs to two spaces:
tab_to_space()
Expand All @@ -169,7 +178,7 @@ tab_to_space()
rm -f $f.tmp
}
export -f tab_to_space
find tests include source unit_tests cookbooks benchmarks doc \( -name '*.cc' -o -name '*.h' -o -name '*.prm' -o -name '*.h.in' -o -name 'CMakeLists.txt' -o -name '*.cmake' -o -name '*.md' \) -print | xargs -P 10 -I {} bash -c 'tab_to_space "$@"' _ {}
find_source_files | xargs -0 -P 10 -I {} bash -c 'tab_to_space "$@"' _ {}

# Remove trailing whitespace from files
remove_trailing_whitespace()
Expand All @@ -182,7 +191,7 @@ remove_trailing_whitespace()
rm -f $f.tmp
}
export -f remove_trailing_whitespace
find tests include source unit_tests cookbooks benchmarks doc \( -name '*.cc' -o -name '*.h' -o -name '*.prm' -o -name '*.h.in' -o -name 'CMakeLists.txt' -o -name '*.cmake' -o -name '*.md' \) -print | xargs -P 10 -I {} bash -c 'remove_trailing_whitespace "$@"' _ {}
find_source_files | xargs -0 -P 10 -I {} bash -c 'remove_trailing_whitespace "$@"' _ {}


# Ensure only a single newline at end of files
Expand All @@ -209,7 +218,7 @@ ensure_single_trailing_newline()
rm -f $f.tmp $f.tmpi
}
export -f ensure_single_trailing_newline
find include source unit_tests cookbooks benchmarks doc \( -name '*.cc' -o -name '*.h' -o -name '*.prm' -o -name '*.h.in' -o -name 'CMakeLists.txt' -o -name '*.cmake' -o -name '*.md' \) -print | xargs -P 10 -I {} bash -c 'ensure_single_trailing_newline "$@"' _ {}
find_source_files | xargs -0 -P 10 -I {} bash -c 'ensure_single_trailing_newline "$@"' _ {}

# Do not recursively search the tests directory for prm files, otherwise the output prms will be changed
find tests \( -name '*.cc' -o -name '*.h' -o -name '*.h.in' -o -name 'CMakeLists.txt' -o -name '*.cmake' \) -print | xargs -P 10 -I {} bash -c 'ensure_single_trailing_newline "$@"' _ {}
Expand Down
4 changes: 2 additions & 2 deletions doc/modules/changes/20240606_hoang
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
New: We implement an option to use the Weighted BFBT preconditioner
introduced by Rudi et al (2017). This preconditioner was designed
New: We implement an option to use the Weighted BFBT preconditioner
introduced by Rudi et al (2017). This preconditioner was designed
for problems involving highly heterogeneous viscosities.
<br>
(Quang Hoang, Timo Heister, 2024/06/06)
2 changes: 1 addition & 1 deletion doc/modules/changes/20241107_lhy11009
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Added: there is now a new class of phase function that handles discrete phase transitions
Added: there is now a new class of phase function that handles discrete phase transitions
by looking up the most dominant phases in a lookup table. This function can be used
to make the rheology of the visco-plastic material model dependent on the dominant
mineral phase.
Expand Down

0 comments on commit 8b5abd1

Please sign in to comment.