You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`make install_clang_tools`| Install clang-format and clang-tidy via apt |
34
+
|`make configure`| Configure cmake build with clang (required before `make lint`) |
34
35
|`make build_linux`| Build for Linux using cmake |
35
36
|`make build_windows`| Build for Windows using cmake |
36
37
|`make build_clean`| Remove the cmake build directory |
@@ -72,9 +73,10 @@ If your change adds or modifies user-facing functionality - such as a new subcom
72
73
73
74
### 4. Linting must pass
74
75
75
-
All C++ code is formatted with clang-format and analysed with clang-tidy. Run the full suite before submitting:
76
+
All C++ code is formatted with clang-format and analysed with clang-tidy. `clang-tidy` needs a compile database generated with clang, so run `make configure` first (`make build_linux`/`make build_windows` alone will not work, since they don't set up the compiler flags clang-tidy needs):
76
77
77
78
```
79
+
make configure
78
80
make lint
79
81
```
80
82
@@ -88,7 +90,7 @@ Then re-run `make lint` to confirm everything passes.
88
90
89
91
### 5. Match the existing code style
90
92
91
-
C++ formatting is enforced by `.clang-format` (Google style base). Static analysis is enforced by `.clang-tidy`. Both configs live in the repo root. Python tests should follow the style of the existing test files.
93
+
C++ formatting is enforced by `.clang-format` (LLVM style base). Static analysis is enforced by `.clang-tidy`. Both configs live in the repo root. Python tests should follow the style of the existing test files.
92
94
93
95
#### Suppression policy
94
96
@@ -106,7 +108,8 @@ Suppressions are occasionally necessary for third-party code or intentional patt
106
108
Use `// clang-format off` / `// clang-format on` only when the default formatting genuinely hurts readability (e.g. column-aligned tables). Add a brief comment explaining the intent:
107
109
108
110
```cpp
109
-
// clang-format off: preserve column-aligned flag-to-char mappings for readability
111
+
// Preserve column-aligned flag-to-char mappings for readability
112
+
// clang-format off
110
113
if (flags & MPQ_FILE_IMPLODE) result += 'i';
111
114
if (flags & MPQ_FILE_COMPRESS) result += 'c';
112
115
// clang-format on
@@ -131,6 +134,6 @@ If you add a new StormLib call that is locale-sensitive, follow the existing pat
131
134
2. Run `git submodule update --init --recursive` after cloning
132
135
3. Run `make install_clang_tools` to install lint dependencies
133
136
4. Make your changes and verify they build: `make build_linux`
134
-
5. Run `make lint` and fix any issues
137
+
5. Run `make configure` and then `make lint`, fixing any issues
135
138
6. Run `make test_mpqcli` and confirm all tests pass
136
139
7. Open a pull request with a clear description of what was changed and why
A command-line tool to create, add, remove, list, extract, read, and verify MPQ archives using the [StormLib library](https://github.com/ladislav-zezula/StormLib).
0 commit comments