-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Formatting updates - formatting workflow - cmake-format - updated clang-format version * remove debug printing * formatting workflow fix
- Loading branch information
Showing
25 changed files
with
580 additions
and
610 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,74 @@ | ||
parse: | ||
additional_commands: | ||
ptl_build_library: | ||
flags: | ||
- RECURSIVE | ||
kwargs: | ||
TYPE: '*' | ||
TARGET_NAME: '*' | ||
OUTPUT_NAME: '*' | ||
SOURCES: '*' | ||
EXTRA_ARGS: '*' | ||
override_spec: {} | ||
vartags: [] | ||
proptags: [] | ||
format: | ||
disable: false | ||
line_width: 90 | ||
tab_size: 4 | ||
use_tabchars: false | ||
fractional_tab_policy: use-space | ||
max_subgroups_hwrap: 2 | ||
max_pargs_hwrap: 8 | ||
max_rows_cmdline: 2 | ||
separate_ctrl_name_with_space: false | ||
separate_fn_name_with_space: false | ||
dangle_parens: false | ||
dangle_align: child | ||
min_prefix_chars: 4 | ||
max_prefix_chars: 10 | ||
max_lines_hwrap: 2 | ||
line_ending: unix | ||
command_case: lower | ||
keyword_case: upper | ||
always_wrap: [] | ||
enable_sort: true | ||
autosort: false | ||
require_valid_layout: false | ||
layout_passes: {} | ||
markup: | ||
bullet_char: '*' | ||
enum_char: . | ||
first_comment_is_literal: false | ||
literal_comment_pattern: null | ||
fence_pattern: ^\s*([`~]{3}[`~]*)(.*)$ | ||
ruler_pattern: ^\s*[^\w\s]{3}.*[^\w\s]{3}$ | ||
explicit_trailing_pattern: '#<' | ||
hashruler_min_length: 10 | ||
canonicalize_hashrulers: true | ||
enable_markup: true | ||
lint: | ||
disabled_codes: [] | ||
function_pattern: '[0-9a-z_]+' | ||
macro_pattern: '[0-9A-Z_]+' | ||
global_var_pattern: '[A-Z][0-9A-Z_]+' | ||
internal_var_pattern: _[A-Z][0-9A-Z_]+ | ||
local_var_pattern: '[a-z][a-z0-9_]+' | ||
private_var_pattern: _[0-9a-z_]+ | ||
public_var_pattern: '[A-Z][0-9A-Z_]+' | ||
argument_var_pattern: '[a-z][a-z0-9_]+' | ||
keyword_pattern: '[A-Z][0-9A-Z_]+' | ||
max_conditionals_custom_parser: 2 | ||
min_statement_spacing: 1 | ||
max_statement_spacing: 2 | ||
max_returns: 6 | ||
max_branches: 12 | ||
max_arguments: 5 | ||
max_localvars: 15 | ||
max_statements: 50 | ||
encode: | ||
emit_byteorder_mark: false | ||
input_encoding: utf-8 | ||
output_encoding: utf-8 | ||
misc: | ||
per_command: {} |
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,64 @@ | ||
# This handles formatting for C/C++ source code and cmake code | ||
name: formatting | ||
|
||
on: | ||
push: | ||
branches: [ master, develop ] | ||
pull_request: | ||
branches: [ master, develop ] | ||
|
||
jobs: | ||
cxx-formatting: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y clang-format-9 cmake | ||
- name: clang-format | ||
run: | | ||
cmake -B build-PTL -DPTL_USE_TBB=OFF . | ||
cmake --build build-PTL --target format-source | ||
rm -rf build-PTL | ||
if [ $(git diff | wc -l) -gt 0 ]; then | ||
echo -e "\nError! Source code not formatted. Run clang-format-9...\n" | ||
echo -e "\nFiles:\n" | ||
git diff --name-only | ||
echo -e "\nFull diff:\n" | ||
git diff | ||
exit 1 | ||
fi | ||
cmake-formatting: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y cmake | ||
python -m pip install --upgrade pip | ||
pip install cmake-format pyyaml | ||
- name: cmake format | ||
run: | | ||
cmake -B build-PTL -DPTL_USE_TBB=OFF . | ||
cmake --build build-PTL --target format-cmake | ||
rm -rf build-PTL | ||
if [ $(git diff | wc -l) -gt 0 ]; then | ||
echo -e "\nError! CMake code not formatted. Run cmake-format...\n" | ||
echo -e "\nFiles:\n" | ||
git diff --name-only | ||
echo -e "\nFull diff:\n" | ||
git diff | ||
exit 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
Oops, something went wrong.