Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-8459: [Dev][Archery] Use a more recent cmake-format #10571

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ repos:
entry: bash -c "git archive HEAD --prefix=apache-arrow/ --output=arrow-src.tar && ./dev/release/run-rat.sh arrow-src.tar"
always_run: true
pass_filenames: false
- id: cmake-format
name: CMake Format
language: python
entry: python run-cmake-format.py
types: [cmake]
additional_dependencies:
- cmake_format==0.5.2
kou marked this conversation as resolved.
Show resolved Hide resolved
- id: hadolint
name: Docker Format
language: docker_image
Expand Down
75 changes: 46 additions & 29 deletions cmake-format.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,61 @@
# under the License.

# cmake-format configuration file
# Use run-cmake-format.py to reformat all cmake files in the source tree
# Use `archery lint --cmake-format --fix` to reformat all cmake files in the
# source tree

# How wide to allow formatted cmake files
line_width = 90
# -----------------------------
# Options affecting formatting.
# -----------------------------
with section("format"):
# How wide to allow formatted cmake files
line_width = 90

# How many spaces to tab for indent
tab_size = 2
# How many spaces to tab for indent
tab_size = 2

# If arglists are longer than this, break them always
max_subargs_per_line = 4
# If a positional argument group contains more than this many arguments,
# then force it to a vertical layout.
max_pargs_hwrap = 4

# If true, separate flow control names from their parentheses with a space
separate_ctrl_name_with_space = False
# If the statement spelling length (including space and parenthesis) is
# smaller than this amount, then force reject nested layouts.
# This value only comes into play when considering whether or not to nest
# arguments below their parent. If the number of characters in the parent
# is less than this value, we will not nest.
min_prefix_chars = 16

# If true, separate function names from parentheses with a space
separate_fn_name_with_space = False
# If true, separate flow control names from their parentheses with a space
separate_ctrl_name_with_space = False

# If a statement is wrapped to more than one line, than dangle the closing
# parenthesis on it's own line
dangle_parens = False
# If true, separate function names from parentheses with a space
separate_fn_name_with_space = False

# What style line endings to use in the output.
line_ending = 'unix'
# If a statement is wrapped to more than one line, than dangle the closing
# parenthesis on it's own line
dangle_parens = False

# Format command names consistently as 'lower' or 'upper' case
command_case = 'lower'
# What style line endings to use in the output.
line_ending = 'unix'

# Format keywords consistently as 'lower' or 'upper' case
keyword_case = 'unchanged'
# Format command names consistently as 'lower' or 'upper' case
command_case = 'lower'

# enable comment markup parsing and reflow
enable_markup = False
# Format keywords consistently as 'lower' or 'upper' case
keyword_case = 'unchanged'

# If comment markup is enabled, don't reflow the first comment block in
# eachlistfile. Use this to preserve formatting of your
# copyright/licensestatements.
first_comment_is_literal = False
# ------------------------------------------------
# Options affecting comment reflow and formatting.
# ------------------------------------------------
with section("markup"):
# enable comment markup parsing and reflow
enable_markup = False

# If comment markup is enabled, don't reflow any comment block which matchesthis
# (regex) pattern. Default is `None` (disabled).
literal_comment_pattern = None
# If comment markup is enabled, don't reflow the first comment block in
# eachlistfile. Use this to preserve formatting of your
# copyright/licensestatements.
first_comment_is_literal = True

# If comment markup is enabled, don't reflow any comment block which
# matchesthis (regex) pattern. Default is `None` (disabled).
literal_comment_pattern = None
Loading