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 git-runic script #122

Merged
merged 2 commits into from
Dec 16, 2024
Merged

Add git-runic script #122

merged 2 commits into from
Dec 16, 2024

Conversation

fredrikekre
Copy link
Owner

Adds the git-runic script (a modified version of git-clang-format) from #120 (comment) to the repository.

@fredrikekre
Copy link
Owner Author

cc @maleadt

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.87%. Comparing base (6d9e931) to head (be80940).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #122   +/-   ##
=======================================
  Coverage   93.87%   93.87%           
=======================================
  Files           8        8           
  Lines        3790     3790           
=======================================
  Hits         3558     3558           
  Misses        232      232           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@maleadt maleadt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Has been working great locally; thanks for adding the necessary features.

README.md Show resolved Hide resolved
@fredrikekre
Copy link
Owner Author

Do you automatically run git runic in a pre-commit hook or similar? Or just manually before committing?

@maleadt
Copy link
Contributor

maleadt commented Dec 16, 2024

I personally do it manually, after staging changes, because I want to be able to choose which formatting changes to accept (I know, going against the philosophy of the tool here).

@fredrikekre fredrikekre merged commit 6625854 into master Dec 16, 2024
10 checks passed
@fredrikekre fredrikekre deleted the fe/git-runic branch December 16, 2024 13:48
@fredrikekre
Copy link
Owner Author

Ha, okay. Just out of curiosity -- what formatting don't you like?

@maleadt
Copy link
Contributor

maleadt commented Dec 16, 2024

I generally like the formatting, but sometimes I've carefully laid out values for clarify, e.g.:

These become:

@@ -56,31 +56,45 @@ end
 Base.Tuple(x::Vec4) = tuple(x.a, x.b, x.c, x.d)

 for (dispatch_rettyp, julia_rettyp, llvm_rettyp) in
-        ((:Signed,        :(Vec4{Int32}),   :v4u32),
-         (:Unsigned,      :(Vec4{UInt32}),  :v4s32),
-         (:AbstractFloat, :(Vec4{Float32}), :v4f32))
+        (
+        (:Signed, :(Vec4{Int32}), :v4u32),
+        (:Unsigned, :(Vec4{UInt32}), :v4s32),
+        (:AbstractFloat, :(Vec4{Float32}), :v4f32),
+    )

@@ -166,9 +184,13 @@ end
     h0y = h0(fy)
     h1y = h1(fy)

-    vals = g0(fy) .* (g0x .* tex(t, px + h0x, py + h0y) .+
-                      g1x .* tex(t, px + h1x, py + h0y)) .+
-           g1(fy) .* (g0x .* tex(t, px + h0x, py + h1y) .+
-                      g1x .* tex(t, px + h1x, py + h1y))
+    vals = g0(fy) .* (
+        g0x .* tex(t, px + h0x, py + h0y) .+
+            g1x .* tex(t, px + h1x, py + h0y)
+    ) .+
+        g1(fy) .* (
+        g0x .* tex(t, px + h0x, py + h1y) .+
+            g1x .* tex(t, px + h1x, py + h1y)
+    )
     return (unpack(T, vals))
 end

It seems silly to annotate those with # RUNIC NO TOUCHY (or whatever the magical comment is), so I think I prefer the manual approach instead.

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.

2 participants