Skip to content

Commit 6f6a9a2

Browse files
committed
chore: clean up dependencies
1 parent 29ccbd3 commit 6f6a9a2

File tree

3 files changed

+11
-47
lines changed

3 files changed

+11
-47
lines changed

package-lock.json

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
},
7878
"license": "MIT",
7979
"dependencies": {
80-
"js-yaml": "^4.1.0",
81-
"minimatch": "^5.0.1"
80+
"js-yaml": "^4.1.0"
8281
}
8382
}

src/extension.ts

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import { EOL } from 'os';
2-
import { join, relative, resolve, sep } from 'path';
1+
import { relative, resolve, sep } from 'path';
32
import * as cp from 'child_process';
43
import { readFile } from 'fs/promises';
54

6-
import * as minimatch from 'minimatch'; // Only needed for githubValiator
75
import * as yaml from 'js-yaml';
86
import * as vscode from 'vscode';
97

@@ -151,44 +149,6 @@ const mockValidator: Validator = (filepath) => {
151149
);
152150
};
153151

154-
/**
155-
* Checks for file ownership by looking at the existing `.github/CODEOWNERS` file
156-
* @param filepath path of the file to check
157-
* @returns an {@link Owner Owner} object or `undefined` if no owner can be determined
158-
*/
159-
const githubValidator: Validator = async (filepath) => {
160-
const config = vscode.Uri.parse(
161-
join(
162-
vscode.workspace.workspaceFolders?.[0]?.uri.fsPath || '',
163-
'.github',
164-
'CODEOWNERS',
165-
),
166-
);
167-
168-
const rel = `${sep}${relative(
169-
vscode.workspace.workspaceFolders?.[0]?.uri.fsPath || '',
170-
filepath,
171-
)}`;
172-
173-
const doc = await vscode.workspace.openTextDocument(config);
174-
175-
const codeowners = doc.getText().split(EOL);
176-
177-
for (const line of codeowners) {
178-
const [pattern, teamName] = line.split(' ');
179-
180-
if (minimatch(rel, pattern)) {
181-
return {
182-
filepath,
183-
teamName,
184-
teamConfig: config.fsPath,
185-
};
186-
}
187-
}
188-
189-
return undefined;
190-
};
191-
192152
const codeownershipValidator: Validator = async (filepath) => {
193153
// bin/codeownership currenlty wants relative paths
194154
const relativePath = relative(process.cwd(), filepath);

0 commit comments

Comments
 (0)