-
Notifications
You must be signed in to change notification settings - Fork 0
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
Handle cases when a project doesn't use codeownership #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
@@ -11,6 +11,7 @@ View code ownership for every file right in the status bar. You'll get the name | |||
Quick access to the owning team's config file. Clicking on the status bar item will open a popup that includes a button that opens the team's config file. See [Code Teams](https://github.com/rubyatscale/code_teams) for more information on team config files. | |||
|
|||
## Installation | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prettier did this on its own 🤷🏻
private async checkConfiguration(): Promise<void> { | ||
const binaryPath = resolve(this.workspace.uri.fsPath, 'bin/codeownership'); | ||
this.isConfigured = existsSync(binaryPath); | ||
this.statusProvider.isConfigured = this.isConfigured; | ||
|
||
if (!this.isConfigured) { | ||
log( | ||
'info', | ||
`No code ownership binary found in workspace: ${this.workspace.name}`, | ||
); | ||
} else { | ||
log( | ||
'info', | ||
`Code ownership binary found in workspace: ${this.workspace.name}`, | ||
); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
I work on lots of codebases aside from ones with code_ownership, and I find it a little annoying to see "Owner: error!" when it isn't expected to work at all.
This adds a concept of checking that a workspace is configured for codeowners, or not. When it's not configured, it shows that with an info icon:
Unrelated, but I fixed an error I was getting while using the debugging, which fixes an infinite recursion. I assume it is either debug/dev specific, or we'd see it more.