mirror of https://github.com/citusdata/citus.git
add sort_and_group_includes to CI
parent
ea4c49e405
commit
3fa4056f97
|
@ -76,6 +76,8 @@ jobs:
|
|||
run: ci/editorconfig.sh && git diff --exit-code
|
||||
- name: Remove useless declarations
|
||||
run: ci/remove_useless_declarations.sh && git diff --cached --exit-code
|
||||
- name: Sort and group includes
|
||||
run: ci/sort_and_group_includes.sh && git diff --cached --exit-code
|
||||
- name: Normalize test output
|
||||
run: ci/normalize_expected.sh && git diff --exit-code
|
||||
- name: Check for C-style comments in migration files
|
||||
|
|
15
ci/README.md
15
ci/README.md
|
@ -385,3 +385,18 @@ definitions are in alphabetical order.
|
|||
## `print_stack_trace.sh`
|
||||
|
||||
This script prints stack traces for failed tests, if they left core files.
|
||||
|
||||
## `sort_and_group_includes.sh`
|
||||
|
||||
This script checks and fixes issues with include grouping and sorting in C files.
|
||||
|
||||
Includes are grouped in the following groups:
|
||||
- System includes (eg. `#include <math>`)
|
||||
- Postgres.h include (eg. `#include "postgres.h"`)
|
||||
- Naked postgres includes (includes not in a directory eg. `#include "miscadmin.h`)
|
||||
- Postgres includes in a directory (eg. `#include "catalog/pg_type.h"`)
|
||||
- Naked citus includes (eg. `#include "pg_version_constants.h"`)
|
||||
- Columnar includes (eg. `#include "columnar/columnar.h"`)
|
||||
- Distributed includes (eg. `#include "distributed/maintenanced.h"`)
|
||||
|
||||
Within every group the include lines are sorted alphabetically.
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
# shellcheck disable=SC1091
|
||||
source ci/ci_helpers.sh
|
||||
|
||||
git ls-files \
|
||||
| git check-attr --stdin citus-style \
|
||||
| grep 'citus-style: set' \
|
||||
| awk '{print $1}' \
|
||||
| cut -d':' -f1 \
|
||||
| xargs -n1 ./ci/include_grouping.py
|
Loading…
Reference in New Issue