Skip to content

chore(lint): Enable revive package-directory-mismatch rule - #9108

Open
uditjainstjis wants to merge 1 commit into
jaegertracing:mainfrom
uditjainstjis:enable-revive-package-directory-mismatch
Open

chore(lint): Enable revive package-directory-mismatch rule#9108
uditjainstjis wants to merge 1 commit into
jaegertracing:mainfrom
uditjainstjis:enable-revive-package-directory-mismatch

Conversation

@uditjainstjis

Copy link
Copy Markdown

Which problem is this PR solving?

  • Part of Enable more revive linter rules #5506 — re-enabling disabled revive rules one at a time. This PR enables package-directory-mismatch, which the config already marks as "should be enabled after fixing or disabling in a few packages".

Description of the changes

  • Running the rule on master flags only two spots:
    1. cmd/jaeger/internal/extension/jaegerquery/internal/ddg — package deepdependencies did not match its ddg directory. Renamed the package to ddg and updated its two importers in the jaegerquery extension (dropping the now-redundant import alias).
    2. internal/storage/v1/api (package storage) and internal/storage/v2/api (package storage_v2) — these intentionally keep a package name that differs from the api directory.
  • Per the discussion on Enable more revive linter rules #5506 about avoiding //nolint comments scattered across the v1/v2 storage packages, the intentional cases are suppressed with a single path-scoped exclusions.rules entry rather than inline directives.

How was this change tested?

  • go build ./... passes.
  • go test passes for the renamed package, its importer (jaegerquery), and the internal/storage/v1/api / internal/storage/v2/api trees.
  • With the rule enabled, golangci-lint run reports zero package-directory-mismatch violations.

Checklist

Re-enables the package-directory-mismatch revive rule (part of jaegertracing#5506).

- Rename package deepdependencies -> ddg so it matches its directory,
  updating the two importers in the jaegerquery extension.
- internal/storage/v1/api (package "storage") and internal/storage/v2/api
  (package "storage_v2") intentionally keep a package name that differs
  from the "api" directory; exclude just those paths from this rule via
  exclusions.rules instead of scattering //nolint comments across files.

Resolves jaegertracing#5506 for this rule.

Signed-off-by: Udit Jain <uditjainstjis@gmail.com>
@uditjainstjis
uditjainstjis requested a review from a team as a code owner July 24, 2026 20:06
@dosubot dosubot Bot added the go Pull requests that update go code label Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant