mm icon indicating copy to clipboard operation
mm copied to clipboard

Format Script Update

Open hensldm opened this issue 3 years ago • 5 comments

Brings over the updated format.sh from OoT that actually checks you have clang-tidy, along with some new clang-tidy options to force function definitions and declarations to be consistent. Also ran it across the whole repo.

hensldm avatar Jul 05 '22 02:07 hensldm

Yeah, most of the renaming come from clang-tidy itself, but I did make two intentional changes that I noticed

  • void EnItem00_DrawHeartContainer(EnItem00* actor, PlayState* play) -> void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play)
  • void ObjRaillift_UpdatePosition(ObjRaillift* this, s32 idx) -> void ObjRaillift_UpdatePosition(ObjRaillift* this, s32 index)

hensldm avatar Jul 08 '22 05:07 hensldm

Going to draft this. Want to to see what happens with https://github.com/zeldaret/oot/pull/1331 and if we should ~~steal~~, I mean ask nicely if we can use it.

hensldm avatar Jul 27 '22 02:07 hensldm

Okay this should be good to go again. Would recommend just trying out the new script if you haven't already.

hensldm avatar Jul 30 '22 15:07 hensldm

Is this PR still waiting for the agents to be updated?

AngheloAlf avatar Sep 22 '22 15:09 AngheloAlf

Is this PR still waiting for the agents to be updated?

I believe we are still waiting on Kenix's agent.

hensldm avatar Sep 23 '22 01:09 hensldm

Jenkins is complaining there are unformatted files, but I can't reproduce the problem locally. Shouldn't this be using a specific clang format version?

AngheloAlf avatar Sep 28 '22 21:09 AngheloAlf

Jenkins is complaining there are unformatted files, but I can't reproduce the problem locally. Shouldn't this be using a specific clang format version?

Hmm, locally I see EnZos change due to clang-tidy (1 function declaration and define don't match). Curious what you did locally (though probably best to debug in discord). As for the other file, it looks like a core file??? That is weird.

hensldm avatar Sep 28 '22 23:09 hensldm

Converting to draft again. For some reason Slug is coring when trying to run clang-apply-replacements, and would like to figure that out first.

hensldm avatar Sep 29 '22 03:09 hensldm

FYI I made a PR with some fixes to format.py in oot (see zeldaret/oot#1387), and it will probably prevent that coring issue you ran into

Roman971 avatar Oct 01 '22 23:10 Roman971

Undrafted. Looks good again. Thanks Roman.

hensldm avatar Oct 02 '22 21:10 hensldm

On Mac I had to add symlinks for clang-tidy and clang-apply-replacements (after installing all of llvm, unfortunately clang-tidy does not have its own distribution on homebrew), so we should add that to the tools document or the script's help.

$ brew install llvm
$ 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"

was the right thing according to the instructions I followed.

EllipticEllipsis avatar Oct 02 '22 23:10 EllipticEllipsis

And I suppose I should note I'm on 15.0.0 and it didn't change anything, so seems fine from that PoV?

EllipticEllipsis avatar Oct 02 '22 23:10 EllipticEllipsis