Ptt-official-app / Ptt-iOS

37 stars 7 forks source link

Integrate SwiftLint #54

Closed xxi511 closed 1 year ago

xxi511 commented 1 year ago

I was tried to fix all of warnings & errors but I realized this is impossible. There are thousands needs to be fixed
Will make this PR becomes incredible big! (Although it is big enough).
I suggest merge this PR then fix error / warning step by step.

About path.

In SwiftLint, it mentions path issue caused by Apple Silicon.
It suggest to use PATH=${PATH}:/opt/homebrew/bin/ or create a symbolic link.
I tried symbolic link but it can't work for Homebrew, after creating symbolic link new error is shown

Warning: your HOMEBREW_PREFIX is set to /usr/local but HOMEBREW_CELLAR is set
to /opt/homebrew/Cellar. Your current HOMEBREW_CELLAR location will stop
you being able to use all the binary packages (bottles) Homebrew provides. We
recommend you move your HOMEBREW_CELLAR to /usr/local/Cellar which will get you
access to all bottles."

Can't find other solution to fix it.
I have to say seems like PATH=${PATH}:/opt/homebrew/bin/ is the easiest way to fix issue.

denkeni commented 1 year ago

In Build Phases for SwiftLint:

PATH=${PATH}:/opt/homebrew/bin/

This is still very strange solution to me. But if this is your only solution, please add note to documentation, say README.md, without relying on GitHub discussions.

brew bundle install --no-upgrade

Why is this command necessary?

denkeni commented 1 year ago

Please resolve conflicts so it can be merged.