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

split policies into separate .rs files #230

Open
mcandre opened this issue May 4, 2023 · 2 comments
Open

split policies into separate .rs files #230

mcandre opened this issue May 4, 2023 · 2 comments

Comments

@mcandre
Copy link
Owner

mcandre commented May 4, 2023

For ease of maintenance.

And replace the terms "policy" / "pplicies" with "check" / "checks". (We would have used "rule" / "rules", but that collides with make rules and PEG grammar rules.

@mcandre mcandre added this to the v0.0.11 milestone May 4, 2023
@mcandre
Copy link
Owner Author

mcandre commented May 4, 2023

Unknown if this is possible in Rust. There seems to be an assumption that each *.rs file declares at most one module, unlike Go.

Meanwhile, what we can do is move the unit tests closer to the entities that they test.

@mcandre mcandre removed this from the v0.0.11 milestone May 4, 2023
@mcandre
Copy link
Owner Author

mcandre commented May 4, 2023

The least boilerplate way of accomplishing the file splitting:

  1. Isolate the Warning struct and the mock utility function in a new module. Isolate the lint function in a lint.rs file.
  2. Start isolating each of the checks in a new checks/<check>.rs file.
  3. Re-import each of the individual checks in the lint module.

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

1 participant