build: bump clang-format to version 18

This commit is contained in:
Marcin Kurczewski 2024-04-09 15:15:58 +02:00
parent ace1aff488
commit c1ce8be31b
4 changed files with 10 additions and 9 deletions

View file

@ -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

View file

@ -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

View file

@ -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;

View file

@ -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__":