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

[Cleanup] Unify header guards #2936

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

Fuzzbawls
Copy link
Collaborator

For a while now, we've been using a mish-mash of various header guard styles, with no real consistency project wide. This PR remedies that by setting a strict header guard notation style.

All first-party headers now follow the below guard style:

#ifndef PIVX_<PATH_TO>_<FILENAME>_H
#define PIVX_<PATH_TO>_<FILENAME>_H
...
#endif // PIVX_<PATH_TO>_<FILENAME>_H

Git subtrees and integrated 3rd party libraries are excluded.

A linter is included so as to prevent future inclusion of include guards that do not adhere to the above standard style.

With this in place, there is more opportunity to "declutter" our file structure quite a bit, especially with regards to the GUI files.

@Fuzzbawls Fuzzbawls added this to the 6.0.0 milestone Sep 1, 2024
@Fuzzbawls Fuzzbawls self-assigned this Sep 1, 2024
Copy link

@panleone panleone left a comment

Choose a reason for hiding this comment

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

only one small nit:

with the current script we check only that the header guard begins with PIVX_<PATH_TO>_<FILENAME>_H

But something like
PIVX_<PATH_TO>_<FILENAME>_H2323asd

would be accepted too.

I suggested a small change to fix the issue

test/lint/lint-include-guards.sh Outdated Show resolved Hide resolved
@Fuzzbawls Fuzzbawls force-pushed the 2024_unify-header-guards branch from 99267aa to c1ca387 Compare September 18, 2024 12:37
Use standardized include guard naming scheme project wide. Excludes 3rd
party libraries and subtrees.
@Fuzzbawls Fuzzbawls force-pushed the 2024_unify-header-guards branch from c1ca387 to 76b04cb Compare October 18, 2024 21:45
Copy link

@panleone panleone left a comment

Choose a reason for hiding this comment

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

tACK 76b04cb

Copy link
Member

@Liquid369 Liquid369 left a comment

Choose a reason for hiding this comment

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

tACK 76b04cb

Copy link
Member

@Duddino Duddino left a comment

Choose a reason for hiding this comment

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

ACK 76b04cb

@Fuzzbawls Fuzzbawls merged commit 67d2db1 into PIVX-Project:master Oct 31, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants