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

Idiomatic namespace alias for clojure.spec.alpha should be s instead of spec #245

Closed
sheluchin opened this issue Oct 15, 2022 · 5 comments
Closed

Comments

@sheluchin
Copy link

All of the official documentation uses s as the namespace alias for clojure.spec.alpha but the style guide's Use Idiomatic Namespace Aliases section suggests to use spec instead. Is there a reason for diverging from the official docs or is this a bug in the style guide?

@seancorfield
Copy link
Collaborator

I totally agree: s is far more idiomatic here. I think that section could be cleaned up a lot. It's widely considered idiomatic to alias namespaces to the last segment (if that is unique), and then a handful have common shorter aliases - so a lot of tired in that table could be removed.

I might have time to put together a PR for discussion tomorrow.

seancorfield added a commit that referenced this issue Oct 15, 2022
@seancorfield
Copy link
Collaborator

(I found a bit of time today for a PR for discussion!)

seancorfield added a commit that referenced this issue Oct 17, 2022
@seancorfield
Copy link
Collaborator

The PR for this has been merged. I'm not sure what's required to get that published on the site.

@seancorfield
Copy link
Collaborator

Ah, it's automatic. I was just impatient.

@sheluchin
Copy link
Author

Thanks very much, @seancorfield. Your PR adds much clarity and corrects the issue.

I referenced your PR in a clj-kondo ticket about adding the community guideline aliases as a linter. It'll be nice to have community standards like this reinforced by the tooling once myself or someone else implements that ticket.

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

No branches or pull requests

2 participants