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

Write custom lints #2386

Closed
kmcallister opened this issue May 9, 2014 · 6 comments
Closed

Write custom lints #2386

kmcallister opened this issue May 9, 2014 · 6 comments

Comments

@kmcallister
Copy link
Contributor

@kmcallister kmcallister commented May 9, 2014

First, implement loadable lints for Rust (rust-lang/rust#14067) or wait for someone else to do it. Then we can statically enforce safety properties beyond Rust's type system.

For example, JS<T> has this currently unchecked requirement:

A rooted, JS-owned value. Must only be used as a field in other JS-owned types.

Each new lint should have some compile-fail tests (#2385).

@jdm
Copy link
Member

@jdm jdm commented May 12, 2014

It would be really useful to annotate various DOM helper traits as only usable by script or layout code (such as LayoutNodeHelpers). This could be done with an annotation like #[layout_only] and ensuring that it's only imported by code under src/components/main/layout.

@kmcallister
Copy link
Contributor Author

@kmcallister kmcallister commented Jul 12, 2014

@jdm: I'll start working on the JS<T> lint, since we're blogging about it in a month :) Did you write any code for that?

@jdm
Copy link
Member

@jdm jdm commented Jul 13, 2014

No code for that yet.

@jdm
Copy link
Member

@jdm jdm commented Jul 13, 2014

Well, I have a branch for compile-fail tests that I could push.

@kmcallister
Copy link
Contributor Author

@kmcallister kmcallister commented Aug 19, 2014

@kmcallister
Copy link
Contributor Author

@kmcallister kmcallister commented Sep 30, 2014

We have this now! Thanks @Manishearth for finishing this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.