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

feat(docs) Add import style guide #192

Merged
merged 1 commit into from
Jul 10, 2024
Merged

feat(docs) Add import style guide #192

merged 1 commit into from
Jul 10, 2024

Conversation

yewman
Copy link
Contributor

@yewman yewman commented Jul 10, 2024

Implement style guide roughly defined here #184

Note:

Consideration of using local imports within modules so that lib files expose only the public interface of a module
Could use the following approach for imports (src/gossip/service.zig)

const sig = https://github.com/import("../lib.zig");
const lib = struct {
const table = https://github.com/import("table.zig");
const active_set = https://github.com/import("active_set.zig");
};

const SocketAddr = sig.net.SocketAddr;
const ServiceManager = sig.utils.service_manager.ServiceManager;
const GossipTable = lib.table.GossipTable;
const HashTimeQueue = lib.table.HashTimeQueue;
const AutoArrayHashSet = lib.table.AutoArrayHashSet;

@yewman yewman requested a review from 0xNineteen July 10, 2024 15:16
@yewman yewman changed the title Add import style guide WIP: Add import style guide Jul 10, 2024
docs/CONTRIBUTING.md Outdated Show resolved Hide resolved
@yewman yewman changed the title WIP: Add import style guide feat(docs) Add import style guide Jul 10, 2024
0xNineteen
0xNineteen previously approved these changes Jul 10, 2024
Copy link
Contributor

@0xNineteen 0xNineteen left a comment

Choose a reason for hiding this comment

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

nice

@yewman yewman merged commit 20a6d3d into main Jul 10, 2024
5 checks passed
@yewman yewman deleted the harnew/contributing branch July 10, 2024 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants