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

modules without within does nothing #1631

Open
parsonsmatt opened this issue Jan 24, 2025 · 1 comment
Open

modules without within does nothing #1631

parsonsmatt opened this issue Jan 24, 2025 · 1 comment

Comments

@parsonsmatt
Copy link

We had an hlint rule like this:

modules:
  - name: [Network.HTTP.Client]
    message: "Please import OpenTelemetry.Instrumentation.HttpClient instead so that requests may be properly traced."

This rule doesn't do anything. The intention was to ban the import of the module. To make it work, we needed to do within: [].

I think it makes sense to infer a within: [] when it is unspecified. The point of within is that it is a list of modules that are opting-out of the rule, and so we are sort of defaulting a missing within to within: **.* which feels way worse.

@zliu41
Copy link
Collaborator

zliu41 commented Jan 29, 2025

This is related to point 2 in this comment. I agree within shouldn't be required for a restriction to take effect.

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