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

Update clang-format #359

Merged
merged 2 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 6 additions & 5 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
BasedOnStyle: google
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortBlocksOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: false
BasedOnStyle: google
ColumnLimit: 0
IndentWidth: 4
InsertBraces: true
PointerBindsToType: false
ColumnLimit: 0
SpaceBeforeParens: ControlStatements
SortIncludes: false
SpaceBeforeParens: ControlStatements
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
- run: git fetch --prune --unshallow
- name: fetch or build Docker container
run: |
docker build --pull --no-cache --rm -t=i3lock -f travis/Dockerfile .
docker build --pull --no-cache --rm -t=i3lock -f ci/Dockerfile .
docker run -e CC -v $PWD:/usr/src:rw i3lock /bin/sh -c 'git config --global --add safe.directory /usr/src && mkdir build && cd build && CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Werror" meson .. && ninja'
formatting:
name: Check formatting
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get install -y clang-format-11
sudo apt-get install -y clang-format-15
- name: Check formatting
run: clang-format-11 --dry-run --Werror $(git ls-files '*.c' 'include/*.h')
run: clang-format-15 --dry-run --Werror $(git ls-files '*.c' 'include/*.h')
2 changes: 1 addition & 1 deletion travis/Dockerfile → ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN echo 'APT::Acquire::Retries "5";' > /etc/apt/apt.conf.d/80retry
# (3608 kB/s)). Hence, let’s stick with httpredir.debian.org (default) for now.

# Install mk-build-deps (for installing the i3 build dependencies),
# clang and clang-format-9 (for checking formatting and building with clang),
# clang (for building),
# lintian (for checking spelling errors),
# test suite dependencies (for running tests)
RUN apt-get update && \
Expand Down
3 changes: 2 additions & 1 deletion dpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ int logical_px(const int logical) {
* systems to 96 dpi in order to get the behavior they expect/are used to,
* but since we can easily detect this case in code, let’s do it for them.
*/
if ((dpi / 96.0) < 1.25)
if ((dpi / 96.0) < 1.25) {
return logical;
}
return ceil((dpi / 96.0) * logical);
}
Loading
Loading