Skip to content

Commit

Permalink
Remove version from clang-format (ros-controls#297)
Browse files Browse the repository at this point in the history
* feat: clang-format

* clang-format-12

* wip: clang-11 to keep compatibility
  • Loading branch information
erickisos authored Feb 25, 2022
1 parent 8dd2b5f commit b9ccf04
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 30 deletions.
5 changes: 2 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Language: Cpp
BasedOnStyle: Google
Language: Cpp
BasedOnStyle: Google

ColumnLimit: 100
AccessModifierOffset: -2
Expand All @@ -12,4 +12,3 @@ DerivePointerAlignment: false
PointerAlignment: Middle
ReflowComments: false
IncludeBlocks: Preserve
...
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master
schedule:
# Run every morning to detect flakiness and broken dependencies
- cron: '17 8 * * *'
- cron: "17 8 * * *"
env:
ROS_DISTRO: galactic

Expand All @@ -15,15 +15,15 @@ jobs:
name: industrial ci
runs-on: ubuntu-latest
strategy:
matrix:
ROS_REPO: [main, testing]
matrix:
ROS_REPO: [main, testing]
env:
UPSTREAM_WORKSPACE: .github/workspace.repos
UPSTREAM_WORKSPACE: .github/workspace.repos
steps:
- uses: actions/checkout@v2
- uses: ros-industrial/industrial_ci@master
env:
ROS_REPO: ${{ matrix.ROS_REPO }}
- uses: actions/checkout@v2
- uses: ros-industrial/industrial_ci@master
env:
ROS_REPO: ${{ matrix.ROS_REPO }}

ros-tooling-ci:
name: ros-tooling ci
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9.7
- name: Install clang-format-10
run: sudo apt-get install clang-format-10 cppcheck
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --hook-stage manual
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9.7
- name: Install clang-format
run: sudo apt install -qq clang-format-11 cppcheck
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --hook-stage manual
20 changes: 10 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# To use:
#
# pre-commit run -a
Expand Down Expand Up @@ -36,32 +35,33 @@ repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.12.0
hooks:
- id: pyupgrade
- id: pyupgrade
args: [--py36-plus]

# PEP 257
- repo: https://github.com/FalconSocial/pre-commit-mirrors-pep257
rev: v0.3.3
hooks:
- id: pep257
args: ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"]
- id: pep257
args:
["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"]

- repo: https://github.com/pycqa/flake8
rev: 3.9.0
hooks:
- id: flake8
args: ["--ignore=E501"]
- id: flake8
args: ["--ignore=E501"]

# CPP hooks
- repo: local
hooks:
- id: clang-format
name: clang-format
description: Format files with ClangFormat.
entry: clang-format-10
entry: clang-format-11
language: system
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$
args: ['-fallback-style=none', '-i']
args: ["-fallback-style=none", "-i"]

- repo: local
hooks:
Expand Down Expand Up @@ -111,7 +111,7 @@ repos:
rev: 0.9.0a1
hooks:
- id: doc8
args: ['--max-line-length=100', '--ignore=D001']
args: ["--max-line-length=100", "--ignore=D001"]
exclude: CHANGELOG\.rst$

- repo: https://github.com/pre-commit/pygrep-hooks
Expand All @@ -128,5 +128,5 @@ repos:
rev: v2.0.0
hooks:
- id: codespell
args: ['--write-changes']
args: ["--write-changes"]
exclude: CHANGELOG\.rst|\.(svg|pyc)$

0 comments on commit b9ccf04

Please sign in to comment.