2024-02-20 21:16:07 +01:00
|
|
|
---
|
|
|
|
title: PR Guidelines
|
|
|
|
---
|
|
|
|
|
|
|
|
## PR Requirements
|
2022-09-04 13:13:24 +02:00
|
|
|
|
|
|
|
- Clean, not hacky code
|
2022-10-23 16:35:39 +02:00
|
|
|
- Described changes and _why_ they were there
|
2022-09-04 13:13:24 +02:00
|
|
|
- Following the style (see below)
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
### Code Style
|
2022-09-04 13:13:24 +02:00
|
|
|
|
2022-12-16 18:22:44 +01:00
|
|
|
Hyprland's code style is governed by the `.clang-format` file.
|
2022-10-23 16:35:39 +02:00
|
|
|
|
2022-12-16 18:22:44 +01:00
|
|
|
Make sure to format accordingly whenever you make a PR.
|
2022-09-04 13:13:24 +02:00
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
### Some code FAQ
|
2022-09-04 13:13:24 +02:00
|
|
|
|
|
|
|
> Why is the config variable getting so weird?
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
Every variable from the config needs to be found in a hashmap. To limit the
|
|
|
|
amount of hashmap searches, getting a config option looks like this:
|
2022-10-23 16:35:39 +02:00
|
|
|
|
2022-09-04 13:13:24 +02:00
|
|
|
```cpp
|
2022-12-16 18:22:44 +01:00
|
|
|
static auto* const PFOLLOWMOUSE = &g_pConfigManager->getConfigValuePtr("input:follow_mouse")->intValue;
|
2022-09-04 13:13:24 +02:00
|
|
|
```
|
2022-10-23 16:35:39 +02:00
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
Since the hashmap _cannot_ be mutated during runtime, this pointer will always
|
|
|
|
be valid, and will not require hashmap lookups every single time it's read.
|