Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automated formatting and linting via clang #10

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

leggettc18
Copy link
Owner

WIP implementation of automatic formatting and linting via clang-format and clang-tidy. Currently not building because it changed definitions of various functions and structs but not where they are used (at least not everywhere).
Uploading as a Draft PR so people can comment and vote on the actual rules used.

We actually had clang-format rules already, but nothing was running them other than manually running the format.sh script, so one ultimate goal of this PR will be making sure that happens somehow, and is verified during the PR
process via GH Actions. I have added clang-tidy rules to this, I've started by yanking the rules libultraship is using, but this can be changed if need be. This sets most things to be CamelCase, for instance font->msgContext
becomes font->MsgContext, EnMa1_DoNothing becomes EnMa1DoNothing, and func_80xxxx becomes Func80xxxx, to list just a few examples. I felt this was closest to what we already had, since it basically just removes underscores.
I felt that was preferable to Camel_Snake_Case which would have added underscores. There are things we could mess around with, like having struct members and class public members be camelBack case, but I think I actually prefer
those being CamelCase so at the time of submitting this draft PR that's how I have it set.

As said, this currently does not build due to needing to update the code in various places to match the definitions, but I wanted to get some feedback on this styling here before I start working on that part.

@leggettc18 leggettc18 force-pushed the clang-format-tidy branch from 507b2e7 to f074bdb Compare July 1, 2023 16:48
leggettc18 pushed a commit that referenced this pull request Nov 6, 2023
* The mother of all commits

* Removed `GI_SWORD_MASTER`;
"Master Sword" Items now actually give MS

* Removed dupe MS entries in item pool;
updated GIMESSAGE (should stop crashing on non-Windows);
re-added MS in item list

* Give Adult Link a freebie with shuffle MS on;
cihld -> adult no longer gives MS;
ToT Master Sword now gives correct item

* add master sword GI draw func based on ToT MS object

* Force `MasterSword` logic var to only update upon getting MS

* Dorf funny line now activates with LA and MS in inv

* Apply suggestions

* Updated RAND_INF;
Check Tracker changes;
Gave RAND_INF and ice trap logic to ToT MS check;
Fixed swordless behavior for HBA/fishing

* ToT MS Check now works in check tracker;
Visual bug where box hovers over non-existent MS gone;
Fixed RAND_INF check with ToT MS pedestal;
Ganon no longer gives free MS

* adult equips no longer reset in MS shuffle

* Apply (most) locacc review suggestions

Co-authored-by: inspectredc <[email protected]>

* Reorganized swordless check for interface to fit edge cases;
getting master sword no longer highlights box

* Edge case for BGS but no bow

* Fix implicit declaration error for GI hooks (#9)

* Adjusted `CanAdultAttack/Damage`; applied logic suggestions

* Fixed build errors (hopefully)

* Cleanup merge

* get shit working again

* Tidied up remaining uses of DD flag as rando indicator

* make master sword invisible and fix ms flag (#10)

* Add text to sheik if go mode is obtained but barrier is still up

* overhaul swordless behavior in `func_80083108`

* reworked ToT MS Check to have an actual GI

* suggestions

* Apply suggestions

* Better swordless handling with temp B (HarbourMasters#11)

* better swordless handling with temp B

* prevent auto save in fishing pond

* prevent auto save during bombchu bowling

* enum fix

---------

Co-authored-by: Adam Bird <[email protected]>
Co-authored-by: inspectredc <[email protected]>
Co-authored-by: RaelCappra <[email protected]>
Co-authored-by: Adam Bird <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant