Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Conversation

@camdencheek
Copy link
Member

@camdencheek camdencheek commented Aug 8, 2023

This adds the unused lint to the set of linters supported by nogo. This PR leaves it disabled because we currently have a lot of dead code lying around.

For anyone who wants to work on sniping some unused code, just uncomment the line in BUILD.bazel

Test plan

❯ bazel build //cmd/frontend/internal/httpapi
...
compilepkg: nogo: errors found by nogo during build-time code analysis:
internal/extsvc/types.go:319:87: bbsLower is unused (unused)
internal/extsvc/types.go:320:62: bbcLower is unused (unused)
internal/extsvc/types.go:321:24: jvmLower is unused (unused)
internal/extsvc/types.go:322:22: npmLower is unused (unused)
internal/extsvc/types.go:324:30: goLower is unused (unused)
internal/extsvc/types.go:324:89: pythonLower is unused (unused)
internal/extsvc/types.go:325:45: rustLower is unused (unused)
internal/extsvc/types.go:326:36: rubyLower is unused (unused)
internal/extsvc/types.go:339:74: supportsRepoExclusion is unused (unused)
Target //cmd/frontend/internal/httpapi:httpapi failed to build

@cla-bot cla-bot bot added the cla-signed label Aug 8, 2023
@camdencheek camdencheek marked this pull request as ready for review August 8, 2023 20:27
@camdencheek camdencheek requested a review from a team August 8, 2023 20:27
Copy link
Contributor

@burmudar burmudar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome stuff! Thanks for adding this! ❤️

@camdencheek camdencheek merged commit 1c67c12 into main Aug 8, 2023
@camdencheek camdencheek deleted the cc/unused-lint branch August 8, 2023 20:47
mrnugget added a commit that referenced this pull request Aug 9, 2023
The linter in #55647 flagged these. They are unused and are a left-over
after the migration to the "Variant" types in this file.
mrnugget added a commit that referenced this pull request Aug 9, 2023
The linter in #55647 flagged these. They are unused and are a left-over
after the migration to the "Variant" types in this file.

## Test plan

- Existing CI
camdencheek referenced this pull request Aug 9, 2023
This removes some unused code as reported by the new [unused
linter](https://github.com/sourcegraph/sourcegraph/pull/55647).

The linter incorrectly reports that some things are unused if they are
only used by tests. It's unclear to me if there is a general solution to
this issue, but for now I'm either ignoring them or moving test-only
stuff to test files.
davejrt pushed a commit that referenced this pull request Aug 9, 2023
This adds the `unused` lint to the set of linters supported by `nogo`.
This PR leaves it disabled because we currently have a _lot_ of dead
code lying around.

For anyone who wants to work on sniping some unused code, just uncomment
the line in `BUILD.bazel`
davejrt pushed a commit that referenced this pull request Aug 9, 2023
The linter in #55647 flagged these. They are unused and are a left-over
after the migration to the "Variant" types in this file.

## Test plan

- Existing CI
davejrt referenced this pull request Aug 9, 2023
This removes some unused code as reported by the new [unused
linter](https://github.com/sourcegraph/sourcegraph/pull/55647).

The linter incorrectly reports that some things are unused if they are
only used by tests. It's unclear to me if there is a general solution to
this issue, but for now I'm either ignoring them or moving test-only
stuff to test files.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants