mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Format Script Update (#904)
* Bring over format.sh and .clang-tidy and run it * Little fixes * Adjustments * Jenkins kick * Jenkins kick 2 * format * small fixes * Bring over new formatter by Roman Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> * Force use of clang-11 * check_format * Update error messages * Fix from Tharo for python3.6 Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> * Just use nproc to determine num jobs for check format * Update error message * AnimatedMat_DrawStepOpa texture arg -> matAnim * Fix enTwig draw prototype * Tidying up * Bring over fixes in OoT #1387 Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> * Fix * Update doc tools * PR Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
This commit is contained in:
co-authored by
Roman971
Tharo
parent
3e32379c2b
commit
26207594f2
+25
-3
@@ -23,7 +23,7 @@
|
||||
- [`tools/warnings_count/check_new_warnings.sh`](#toolswarnings_countcheck_new_warningssh)
|
||||
- [`tools/warnings_count/update_current_warnings.sh`](#toolswarnings_countupdate_current_warningssh)
|
||||
- [`fixle.sh`](#fixlesh)
|
||||
- [`format.sh`](#formatsh)
|
||||
- [`format.py`](#formatpy)
|
||||
- [External tools](#external-tools)
|
||||
- [mips_to_c](#mips_to_c)
|
||||
- [Permuter](#permuter)
|
||||
@@ -196,9 +196,31 @@ If you have to add new warnings, **and have permission from the leads**, run thi
|
||||
|
||||
Fixes line endings in the repo to Linux style (LF), which is required for the build process to work. (You may be better off creating a new clone directly in Linux/WSL, though)
|
||||
|
||||
### `format.sh`
|
||||
### `format.py`
|
||||
|
||||
Formats all C files in the repo using `clang-format-11` (instructions on how to install this version are pinned in Discord if you can't get it from your package manager in the usual way). This will touch all files in the repo, so the next `make` will take longer.
|
||||
Formats all C files in the repo using `clang-format-11`, `clang-tidy`, and `clang-apply-replacements` (when multiprocessing). This will touch all files in the repo, so the next `make` will take longer.
|
||||
|
||||
You can specify how many threads you would like this to run with by adding the `-jN` flag. Where N is the number of threads. By default this will run using 1 thread (i.e. `-j1`).
|
||||
|
||||
`clang-11` is available in many native package managers, but if not try:
|
||||
|
||||
Linux:
|
||||
Download llvm's setup script, run it, than install normally
|
||||
```bash
|
||||
wget https://apt.llvm.org/llvm.sh
|
||||
chmod +x llvm.sh
|
||||
sudo ./llvm.sh 11
|
||||
rm llvm.sh
|
||||
sudo apt install clang-format-11 clang-tidy-11 clang-apply-replacements-11
|
||||
```
|
||||
|
||||
Mac:
|
||||
Install with brew, than create symlinks for `clang-tidy` and `clang-apply-replacements` to use properly
|
||||
```bash
|
||||
brew install llvm clang-format-11
|
||||
ln -s "$(brew --prefix llvm)/bin/clang-tidy" "/usr/local/bin/clang-tidy"
|
||||
ln -s "$(brew --prefix llvm)/bin/clang-apply-replacements" "/usr/local/bin/clang-apply-replacements"
|
||||
```
|
||||
|
||||
## External tools
|
||||
|
||||
|
||||
Reference in New Issue
Block a user