theos / theos/headers

Code Style

Open
#24 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
384
Forks
101
PR merge metrics
No merged PRs in 30d

Description

Per README:

Follow the existing coding style

There are many different styles throughout the headers, even ignoring vendor headers (e.g. openssl).

I believe there should be a more unified, and explicit style.

Examples of different existing styles

Style discussions are sometimes criticized, because developers have different opinions on how code should be formatted, however I mention these three because I've seen issues arise in due to these in particular.

Availability attributions are important, especially for projects such as this one, where private system APIs are sometimes documented. Deciding on an attribution system allows developers to contribute more easily and effectively.

External declarations must be accurate when using C++, to avoid linking errors. Theos used to create ObjC++ source files by default. A unified extern marking system would avoid issues such as FSSwitchState.h missing a C++ linker hint.

Property attributes are very strongly a style choice, but I mention it due to #21 changing these property declarations. It could be bothersome, if someone felt compelled to change them back, or if new changes are made with no property trailing space, and someone else goes to change those.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the README and the cited headers, including SpringBoard/SBApplication.h, BatteryCenter/BCBatteryDevice.h, Preferences/PSSpecifier.h, GraphicsServices/GSCapability.h, Flipswitch/FSSwitchState.h, and BaseBoard/BSProcessHandle.h. Define an explicit, unified convention for availability attributions, external declarations, and property spacing; done means the project has an agreed style that resolves these examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, objective-c
Domain
developer-experience
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.