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: forbid identifiers with camelcase pubSub #1709

Merged

Conversation

adklempner
Copy link
Member

Problem

cspell does not allow flagging of words based on patterns, making it difficult it to enforce usage of pubsub over pubSub #1704

Solution

Add a rule to eslint the use of any identifier which contains the string pubSub or PubSub.

From this point on, any commits that include an identifier which matches the above condition will be caught via pre commit hook. This does not apply to files which are not checked by eslint, and does not catch the pattern if it's used outside of an identifier (e.g. comments or string literals)

Notes

@adklempner adklempner requested a review from a team as a code owner November 7, 2023 18:01
Copy link

github-actions bot commented Nov 7, 2023

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku core 83.85 KB (0%) 1.7 s (0%) 2.2 s (-16.55% 🔽) 3.9 s
Waku Simple Light Node 264.26 KB (0%) 5.3 s (0%) 7.6 s (+65.38% 🔺) 12.9 s
ECIES encryption 79.46 KB (0%) 1.6 s (0%) 5.1 s (+23.68% 🔺) 6.7 s
Symmetric encryption 79.46 KB (0%) 1.6 s (0%) 5.3 s (+41.32% 🔺) 6.9 s
DNS discovery 111.23 KB (0%) 2.3 s (0%) 6.3 s (+29.23% 🔺) 8.5 s
Privacy preserving protocols 131.77 KB (0%) 2.7 s (0%) 5.1 s (+5.86% 🔺) 7.7 s
Light protocols 81.61 KB (0%) 1.7 s (0%) 2.5 s (+50.2% 🔺) 4.1 s
History retrieval protocols 80.53 KB (0%) 1.7 s (0%) 3 s (+39.08% 🔺) 4.6 s
Deterministic Message Hashing 5.65 KB (0%) 113 ms (0%) 524 ms (+61.05% 🔺) 637 ms

@adklempner
Copy link
Member Author

@danisharora099 danisharora099 changed the base branch from master to chore/deprecate-named-pubsub November 8, 2023 08:33
@danisharora099 danisharora099 changed the base branch from chore/deprecate-named-pubsub to chore/pubusb-topic-namespace November 8, 2023 08:34
@danisharora099 danisharora099 force-pushed the adklempner/forbid-pubSub branch 2 times, most recently from 6aba1b4 to f41de98 Compare November 8, 2023 14:09
@danisharora099 danisharora099 force-pushed the chore/pubusb-topic-namespace branch from e2d27d0 to 6f9f98b Compare November 8, 2023 14:10
@danisharora099 danisharora099 merged commit f10dc81 into chore/pubusb-topic-namespace Nov 8, 2023
23 of 31 checks passed
@danisharora099 danisharora099 deleted the adklempner/forbid-pubSub branch November 8, 2023 14:10
@danisharora099
Copy link
Collaborator

nice!

danisharora099 added a commit that referenced this pull request Nov 14, 2023
* rename all PubSub patterns

* feat: forbid identifiers with camelcase pubSub (#1709)

---------

Co-authored-by: Arseniy Klempner <[email protected]>
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.

feat: ability to flag words based on patterns
2 participants