Skip to content

Commit

Permalink
build: bump clang-format to version 18
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Apr 9, 2024
1 parent 3f0c4c8 commit 97302d6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ jobs:
- name: Install dependencies
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
echo 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main' | sudo tee -a /etc/apt/sources.list
echo 'deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main' | sudo tee -a /etc/apt/sources.list
echo 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' | sudo tee -a /etc/apt/sources.list
echo 'deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt-get install -y clang-format-17 iwyu
sudo apt-get install -y clang-format-18 iwyu
sudo snap install --edge --classic just
sudo ln -s /usr/bin/clang-format-17 /usr/local/bin/clang-format
sudo ln -s /usr/bin/clang-format-18 /usr/local/bin/clang-format
sudo apt-get install -y python3-pip
sudo python3 -m pip install pyjson5 pre-commit
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pre-commit install
To install required external dependencies on Ubuntu:

```
apt-get install -y iwyu clang-format-17
apt-get install -y iwyu clang-format-18
```

After this, each time you make a commit a hook should trigger to automatically
Expand Down
2 changes: 1 addition & 1 deletion src/game/console_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <stdio.h>
#include <string.h>

#define ENDS_WITH_ZERO(num) (fabsf((num)-roundf((num))) < 0.0001f)
#define ENDS_WITH_ZERO(num) (fabsf((num) - roundf((num))) < 0.0001f)

typedef struct ITEM_NAME {
const GAME_OBJECT_ID obj_id;
Expand Down
7 changes: 4 additions & 3 deletions tools/update_gameflow
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ def main() -> None:
assert string_map

for gameflow_path in SHIP_DIR.rglob("*gameflow*.json*"):
gameflow = gameflow_path.read_text()
gameflow = postprocess_gameflow(gameflow, string_map)
gameflow_path.write_text(gameflow)
old_gameflow = gameflow_path.read_text()
new_gameflow = postprocess_gameflow(old_gameflow, string_map)
if new_gameflow != old_gameflow:
gameflow_path.write_text(new_gameflow)


if __name__ == "__main__":
Expand Down

0 comments on commit 97302d6

Please sign in to comment.