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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+80-4Lines changed: 80 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,40 @@ If you are unsure whether a feature fits the project, or whether an existing too
8
8
9
9
**mpqcli follows the Unix philosophy.** The tool is designed to do one thing well and to compose with other tools via pipes and redirection. If you find yourself wanting to add functionality that could be handled by a separate tool — for example, sorting the output of `list` — the right answer is usually to pipe the output to that tool rather than adding it here.
|`make lint_cpp`| Run clang-tidy static analysis |
43
+
|`make clean`| Remove all build and test artifacts |
44
+
11
45
## Requirements for a Pull Request
12
46
13
47
### 1. Builds on your platform
@@ -36,12 +70,54 @@ All tests must pass without errors.
36
70
37
71
If your change adds or modifies user-facing functionality — such as a new subcommand flag or a change in output format — please include a corresponding test in the `test/` directory. The existing test files (`test_list.py`, `test_add.py`, etc.) are good references for the test style and fixtures used.
38
72
39
-
### 4. Match the existing code style
73
+
### 4. Linting must pass
74
+
75
+
All C++ code is formatted with clang-format and analysed with clang-tidy. Run the full suite before submitting:
76
+
77
+
```
78
+
make lint
79
+
```
40
80
41
-
There is no enforced formatter. Write C++ that looks consistent with the surrounding code, and Python tests that follow the style of the existing test files.
81
+
If there are formatting violations, auto-fix them with:
82
+
83
+
```
84
+
make lint_format_fix
85
+
```
86
+
87
+
Then re-run `make lint` to confirm everything passes.
88
+
89
+
### 5. Match the existing code style
90
+
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.
92
+
93
+
#### Suppression policy
94
+
95
+
Suppressions are occasionally necessary for third-party code or intentional patterns. When suppressing a clang-tidy warning:
96
+
97
+
- Use `// NOLINT(check-name)` with the specific check name — bare `// NOLINT` is not acceptable
98
+
- Every suppression must have a comment explaining why it is justified
99
+
100
+
```cpp
101
+
// NOLINT(bugprone-easily-swappable-parameters): parameters validated by CLI11
102
+
```
103
+
104
+
#### Disabling clang-format locally
105
+
106
+
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
+
108
+
```cpp
109
+
// clang-format off: preserve column-aligned flag-to-char mappings for readability
110
+
if (flags & MPQ_FILE_IMPLODE) result += 'i';
111
+
if (flags & MPQ_FILE_COMPRESS) result += 'c';
112
+
// clang-format on
113
+
```
42
114
43
115
## Workflow Summary
44
116
45
117
1. Fork the repository and create a branch for your change
46
-
2. Make your changes and verify they build and all tests pass
47
-
3. Open a pull request with a clear description of what was changed and why
118
+
2. Run `git submodule update --init --recursive` after cloning
119
+
3. Run `make install_clang_tools` to install lint dependencies
120
+
4. Make your changes and verify they build: `make build_linux`
121
+
5. Run `make lint` and fix any issues
122
+
6. Run `make test_mpqcli` and confirm all tests pass
123
+
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