go-text / typesetting

High quality text shaping in pure Go.
Other
101 stars 10 forks source link

Minor improvements/cleanups suggested by staticcheck #35

Closed Jacalz closed 1 year ago

Jacalz commented 1 year ago

This fixes the three suggestions that staticcheck had:

segmenter/unicode14_rules.go:424:10: empty branch (SA9003)
shaping/shaper.go:77:27: type assertion to the same type: input.Face already has type harfbuzz.Face (S1040)
shaping/wrapping.go:293:19: func (*breaker).nextValid is unused (U1000)

I also added staticcheck to the GitHub Actions. We run this as part of our test suite within Fyne. Staticcheck gives a lot of great suggestions and makes sure that code quality stays on top. I genuinely believe that it is the best static analysis tool for Go :)

Jacalz commented 1 year ago

FYI: Tests passed: https://github.com/Jacalz/typesetting/actions/runs/3666072162 :D

Jacalz commented 1 year ago

I realized that there is no point in running it for every Go version. There is now a second workflow that runs staiccheck and go vet.

andydotxyz commented 1 year ago

I can't seem to merge this - I don't know if it's the GitHub app or my permissions but it says I can't modify workflows.

whereswaldon commented 1 year ago

@andydotxyz I took a look through our permissions, and I can't see why. You're an Org-level owner, and there are no special permission overrides for this repo. Maybe it's just a poor UX in the mobile app?

andydotxyz commented 1 year ago

I can try on my laptop once I find a power outlet :) (i'm currently a digital-nomad in London)

andydotxyz commented 1 year ago

Wow, it was just the app being broken!