You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Create a wrapper package for go-enry which only allows "safe" APIs (i.e. doesn't forward APIs like GetLanguageByExtension and similar which arbitrarily return a language + a boolean value determining if there is ambiguity or not).
Change all existing usages of go-enry to go through the new package.
Add a lint preventing direct usage of go-enry outside the wrapper package.
One potential approach:
go-enrywhich only allows "safe" APIs (i.e. doesn't forward APIs likeGetLanguageByExtensionand similar which arbitrarily return a language + a boolean value determining if there is ambiguity or not).go-enryto go through the new package.go-enryoutside the wrapper package.Example place relying on ad-hoc listing of file mappings per language: https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/codeintel/uploads/shared/indexers2.go?L79-93