@eclipse-glsp/cli 2.1.0-next.e32e40e.153 → 2.2.0-next.886d2d0.156
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/check-header.d.ts +2 -6
- package/lib/commands/check-header.d.ts.map +1 -1
- package/lib/commands/check-header.js +35 -98
- package/lib/commands/check-header.js.map +1 -1
- package/lib/commands/release/release-vscode-integration.js +1 -1
- package/lib/commands/release/release-vscode-integration.js.map +1 -1
- package/lib/util/git-util.d.ts +0 -20
- package/lib/util/git-util.d.ts.map +1 -1
- package/lib/util/git-util.js +1 -55
- package/lib/util/git-util.js.map +1 -1
- package/package.json +3 -3
- package/src/commands/check-header.ts +41 -126
- package/src/commands/release/release-vscode-integration.ts +2 -1
- package/src/util/git-util.ts +0 -54
|
@@ -5,20 +5,16 @@ export interface HeaderCheckOptions {
|
|
|
5
5
|
json: boolean;
|
|
6
6
|
excludeDefaults: boolean;
|
|
7
7
|
autoFix: boolean;
|
|
8
|
-
severity: Severity;
|
|
9
8
|
}
|
|
10
9
|
declare const checkTypes: readonly ["full", "changes", "lastCommit"];
|
|
11
|
-
type CheckType = typeof checkTypes[number];
|
|
12
|
-
declare const severityTypes: readonly ["error", "warn", "ok"];
|
|
13
|
-
type Severity = typeof severityTypes[number];
|
|
10
|
+
type CheckType = (typeof checkTypes)[number];
|
|
14
11
|
export declare const CheckHeaderCommand: import("commander").Command;
|
|
15
12
|
export declare function checkHeaders(rootDir: string, options: HeaderCheckOptions): void;
|
|
16
13
|
export declare function handleValidationResults(rootDir: string, results: ValidationResult[], options: HeaderCheckOptions): void;
|
|
17
14
|
interface ValidationResult {
|
|
18
15
|
file: string;
|
|
19
|
-
severity: Severity;
|
|
20
16
|
violation: Violation;
|
|
21
17
|
}
|
|
22
|
-
type Violation = 'none' | 'noOrMissingHeader' | '
|
|
18
|
+
type Violation = 'none' | 'noOrMissingHeader' | 'invalidEndYear';
|
|
23
19
|
export {};
|
|
24
20
|
//# sourceMappingURL=check-header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-header.d.ts","sourceRoot":"","sources":["../../src/commands/check-header.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check-header.d.ts","sourceRoot":"","sources":["../../src/commands/check-header.ts"],"names":[],"mappings":"AA4BA,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,UAAU,4CAA6C,CAAC;AAC9D,KAAK,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAO7C,eAAO,MAAM,kBAAkB,6BA0BN,CAAC;AAE1B,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAgB/E;AAiGD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAwBvH;AA4CD,UAAU,gBAAgB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;CACxB;AAYD,KAAK,SAAS,GAAG,MAAM,GAAG,mBAAmB,GAAG,gBAAgB,CAAC"}
|
|
@@ -52,14 +52,13 @@ const logger_1 = require("../util/logger");
|
|
|
52
52
|
const validation_util_1 = require("../util/validation-util");
|
|
53
53
|
const path = require("path");
|
|
54
54
|
const checkTypes = ['full', 'changes', 'lastCommit'];
|
|
55
|
-
const severityTypes = ['error', 'warn', 'ok'];
|
|
56
55
|
const DEFAULT_EXCLUDES = ['**/@(node_modules|lib|dist|bundle)/**'];
|
|
57
|
-
const YEAR_RANGE_REGEX = /\d{4}
|
|
58
|
-
const HEADER_PATTERN = 'Copyright \\([cC]\\) \\d{4}
|
|
56
|
+
const YEAR_RANGE_REGEX = /\d{4}/g;
|
|
57
|
+
const HEADER_PATTERN = 'Copyright \\([cC]\\) \\d{4}';
|
|
59
58
|
const AUTO_FIX_MESSAGE = 'Fix copyright header violations';
|
|
60
59
|
exports.CheckHeaderCommand = (0, command_util_1.baseCommand)() //
|
|
61
60
|
.name('checkHeaders')
|
|
62
|
-
.description('Validates the copyright year range of license header files')
|
|
61
|
+
.description('Validates the copyright year range (end year) of license header files')
|
|
63
62
|
.argument('<rootDir>', 'The starting directory for the check', validation_util_1.validateGitDirectory)
|
|
64
63
|
.addOption(new commander_1.Option('-t, --type <type>', 'The scope of the check. In addition to a full recursive check, is also possible to only' +
|
|
65
64
|
' consider pending changes or the last commit')
|
|
@@ -69,9 +68,6 @@ exports.CheckHeaderCommand = (0, command_util_1.baseCommand)() //
|
|
|
69
68
|
.addOption(new commander_1.Option('-e, --exclude <exclude...>', 'File patterns that should be excluded from the check. New exclude patterns are added to the default patterns').default([], `[${DEFAULT_EXCLUDES}]`))
|
|
70
69
|
.option('--no-exclude-defaults', 'Disables the default excludes patterns. Only explicitly passed exclude patterns (-e, --exclude) are considered')
|
|
71
70
|
.option('-j, --json', 'Also persist validation results as json file', false)
|
|
72
|
-
.addOption(new commander_1.Option('-s, --severity <severity>', 'The severity of validation results that should be printed.')
|
|
73
|
-
.choices(severityTypes)
|
|
74
|
-
.default('error', '"error" (only)'))
|
|
75
71
|
.option('-a, --autoFix', 'Auto apply & commit fixes without prompting the user', false)
|
|
76
72
|
.action(checkHeaders);
|
|
77
73
|
function checkHeaders(rootDir, options) {
|
|
@@ -108,13 +104,8 @@ function getFiles(rootDir, options) {
|
|
|
108
104
|
}
|
|
109
105
|
function validate(rootDir, files, options) {
|
|
110
106
|
var _a;
|
|
111
|
-
// Derives all files with valid headers
|
|
107
|
+
// Derives all files with valid headers and all files with no or invalid headers
|
|
112
108
|
const filesWithHeader = sh.grep('-l', HEADER_PATTERN, files).stdout.trim().split('\n');
|
|
113
|
-
const copyrightYears = sh
|
|
114
|
-
.grep(HEADER_PATTERN, files)
|
|
115
|
-
.stdout.trim()
|
|
116
|
-
.split('\n')
|
|
117
|
-
.map(line => line.match(YEAR_RANGE_REGEX).map(string => Number.parseInt(string, 10)));
|
|
118
109
|
const noHeaders = files.filter(file => !filesWithHeader.includes(file));
|
|
119
110
|
const results = [];
|
|
120
111
|
const allFilesLength = files.length;
|
|
@@ -125,7 +116,7 @@ function validate(rootDir, files, options) {
|
|
|
125
116
|
}
|
|
126
117
|
noHeaders.forEach((file, i) => {
|
|
127
118
|
printFileProgress(i + 1, allFilesLength, `Validating ${file}`);
|
|
128
|
-
results.push({ file: path.resolve(rootDir, file), violation: 'noOrMissingHeader'
|
|
119
|
+
results.push({ file: path.resolve(rootDir, file), violation: 'noOrMissingHeader' });
|
|
129
120
|
});
|
|
130
121
|
// Performance optimization: avoid retrieving the dates for each individual file by precalculating the endYear if possible.
|
|
131
122
|
let defaultEndYear;
|
|
@@ -138,74 +129,32 @@ function validate(rootDir, files, options) {
|
|
|
138
129
|
// Create validation results for all files with valid headers
|
|
139
130
|
filesWithHeader.forEach((file, i) => {
|
|
140
131
|
printFileProgress(i + 1 + noHeadersLength, allFilesLength, `Validating ${file}`);
|
|
132
|
+
const copyrightLine = sh.head({ '-n': 2 }, file).stdout.trim().split('\n')[1];
|
|
133
|
+
const copyRightYears = copyrightLine.match(YEAR_RANGE_REGEX);
|
|
134
|
+
const currentStartYear = Number.parseInt(copyRightYears[0], 10);
|
|
135
|
+
const currentEndYear = copyRightYears[1] ? Number.parseInt(copyRightYears[1], 10) : undefined;
|
|
141
136
|
const result = {
|
|
142
|
-
currentStartYear
|
|
143
|
-
|
|
144
|
-
currentEndYear: copyrightYears[i].shift(),
|
|
137
|
+
currentStartYear,
|
|
138
|
+
currentEndYear,
|
|
145
139
|
expectedEndYear: defaultEndYear !== null && defaultEndYear !== void 0 ? defaultEndYear : (0, git_util_1.getLastModificationDate)(file, rootDir, AUTO_FIX_MESSAGE).getFullYear(),
|
|
146
140
|
file,
|
|
147
|
-
severity: 'ok',
|
|
148
141
|
violation: 'none'
|
|
149
142
|
};
|
|
150
|
-
|
|
151
|
-
validateSingleYear(result);
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
validateTimePeriod(result);
|
|
155
|
-
}
|
|
143
|
+
validateEndYear(result);
|
|
156
144
|
results.push(result);
|
|
157
145
|
});
|
|
158
146
|
results.sort((a, b) => a.file.localeCompare(b.file));
|
|
159
147
|
process.stdout.clearLine(0);
|
|
160
148
|
return results;
|
|
161
149
|
}
|
|
162
|
-
function
|
|
163
|
-
const { currentStartYear,
|
|
164
|
-
result.violation = '
|
|
165
|
-
|
|
166
|
-
if (
|
|
167
|
-
if (currentStartYear === expectedStartYear) {
|
|
168
|
-
result.violation = 'none';
|
|
169
|
-
result.severity = 'ok';
|
|
170
|
-
}
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
// Cornercase: For files of the initial contribution the copyright header predates the first git modification date.
|
|
174
|
-
// => declare as warning if not part of the initial contribution.
|
|
175
|
-
if (expectedStartYear === currentEndYear && currentStartYear < expectedStartYear) {
|
|
176
|
-
if ((0, git_util_1.getFirstCommit)(result.file) === (0, git_util_1.getInitialCommit)()) {
|
|
177
|
-
result.violation = 'none';
|
|
178
|
-
result.severity = 'ok';
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
result.severity = 'warn';
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
function validateTimePeriod(result) {
|
|
186
|
-
const { currentStartYear, expectedStartYear, expectedEndYear, currentEndYear } = result;
|
|
187
|
-
result.violation = 'incorrectCopyrightPeriod';
|
|
188
|
-
result.severity = 'error';
|
|
189
|
-
if (!currentEndYear) {
|
|
190
|
-
result.severity = 'error';
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
if (currentStartYear === expectedStartYear && currentEndYear === expectedEndYear) {
|
|
150
|
+
function validateEndYear(result) {
|
|
151
|
+
const { currentStartYear, expectedEndYear, currentEndYear } = result;
|
|
152
|
+
result.violation = 'invalidEndYear';
|
|
153
|
+
const valid = currentEndYear ? currentEndYear === expectedEndYear : currentStartYear === expectedEndYear;
|
|
154
|
+
if (valid) {
|
|
194
155
|
result.violation = 'none';
|
|
195
|
-
result.severity = 'ok';
|
|
196
156
|
return;
|
|
197
157
|
}
|
|
198
|
-
// Cornercase: For files of the initial contribution the copyright header predates the first git modification date.
|
|
199
|
-
// => declare as warning if not part of the initial contribution.
|
|
200
|
-
if (currentEndYear === expectedEndYear && currentStartYear < expectedEndYear) {
|
|
201
|
-
if ((0, git_util_1.getFirstCommit)(result.file) === (0, git_util_1.getInitialCommit)()) {
|
|
202
|
-
result.violation = 'none';
|
|
203
|
-
result.severity = 'ok';
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
result.severity = 'warn';
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
158
|
}
|
|
210
159
|
function printFileProgress(currentFileCount, maxFileCount, message, clear = true) {
|
|
211
160
|
if (clear) {
|
|
@@ -220,15 +169,9 @@ function printFileProgress(currentFileCount, maxFileCount, message, clear = true
|
|
|
220
169
|
function handleValidationResults(rootDir, results, options) {
|
|
221
170
|
logger_1.LOGGER.newLine();
|
|
222
171
|
logger_1.LOGGER.info(`Header validation for ${results.length} files completed`);
|
|
223
|
-
const violations = results.filter(result => result.
|
|
172
|
+
const violations = results.filter(result => result.violation !== 'none');
|
|
224
173
|
// Adjust results to print based on configured severity level
|
|
225
|
-
|
|
226
|
-
if (options.severity === 'error') {
|
|
227
|
-
toPrint = violations;
|
|
228
|
-
}
|
|
229
|
-
else if (options.severity === 'warn') {
|
|
230
|
-
toPrint = results.filter(result => result.severity !== 'ok');
|
|
231
|
-
}
|
|
174
|
+
const toPrint = violations;
|
|
232
175
|
logger_1.LOGGER.info(`Found ${toPrint.length} copyright header violations:`);
|
|
233
176
|
logger_1.LOGGER.newLine();
|
|
234
177
|
toPrint.forEach((result, i) => logger_1.LOGGER.info(`${i + 1}. `, result.file, ':', toPrintMessage(result)));
|
|
@@ -237,42 +180,36 @@ function handleValidationResults(rootDir, results, options) {
|
|
|
237
180
|
fs.writeFileSync(path.join(rootDir, 'headerCheck.json'), JSON.stringify(results, undefined, 2));
|
|
238
181
|
}
|
|
239
182
|
if (violations.length > 0 && (options.autoFix || readline.keyInYN('Do you want automatically fix copyright year range violations?'))) {
|
|
240
|
-
const toFix = violations.filter(violation =>
|
|
183
|
+
const toFix = violations.filter(violation => isDateValidationResult(violation));
|
|
241
184
|
fixViolations(rootDir, toFix, options);
|
|
242
185
|
}
|
|
243
186
|
logger_1.LOGGER.info('Check completed');
|
|
244
187
|
}
|
|
245
188
|
exports.handleValidationResults = handleValidationResults;
|
|
246
189
|
function toPrintMessage(result) {
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
: result.expectedStartYear.toString();
|
|
257
|
-
const actual = result.currentEndYear ? `${result.currentStartYear}-${result.currentEndYear}` : result.currentStartYear.toString();
|
|
258
|
-
const message = result.violation === 'incorrectCopyrightPeriod' ? 'Invalid copyright period' : 'Invalid copyright year';
|
|
259
|
-
return `${colors[result.severity]} ${message}! Expected '${expected}' but is '${actual}'`;
|
|
190
|
+
const error = '\x1b[31m';
|
|
191
|
+
const info = '\x1b[32m';
|
|
192
|
+
if (isDateValidationResult(result) && result.violation === 'invalidEndYear') {
|
|
193
|
+
const expected = result.expectedEndYear.toString();
|
|
194
|
+
const actual = result.currentEndYear
|
|
195
|
+
? `${result.currentEndYear} (${result.currentStartYear}-${result.currentEndYear})`
|
|
196
|
+
: result.currentStartYear.toString();
|
|
197
|
+
const message = 'Invalid copyright end year';
|
|
198
|
+
return `${error} ${message}! Expected end year '${expected}' but is '${actual}'`;
|
|
260
199
|
}
|
|
261
200
|
else if (result.violation === 'noOrMissingHeader') {
|
|
262
|
-
return `${
|
|
201
|
+
return `${error} No or invalid copyright header!`;
|
|
263
202
|
}
|
|
264
|
-
return `${
|
|
203
|
+
return `${info} OK`;
|
|
265
204
|
}
|
|
266
205
|
function fixViolations(rootDir, violations, options) {
|
|
267
206
|
logger_1.LOGGER.newLine();
|
|
268
207
|
violations.forEach((violation, i) => {
|
|
269
208
|
printFileProgress(i + 1, violations.length, `Fix ${violation.file}`, false);
|
|
270
|
-
const fixedStartYear = violation.currentStartYear < violation.expectedStartYear ? violation.currentStartYear : violation.expectedStartYear;
|
|
271
209
|
const currentRange = `${violation.currentStartYear}${violation.currentEndYear ? '-' + violation.currentEndYear : ''}`;
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
210
|
+
const fixedRange = violation.currentEndYear || violation.currentStartYear < violation.expectedEndYear
|
|
211
|
+
? `${violation.currentStartYear}-${violation.expectedEndYear}`
|
|
212
|
+
: `${violation.expectedEndYear}`;
|
|
276
213
|
sh.sed('-i', RegExp('Copyright \\([cC]\\) ' + currentRange), `Copyright (c) ${fixedRange}`, violation.file);
|
|
277
214
|
});
|
|
278
215
|
logger_1.LOGGER.newLine();
|
|
@@ -285,6 +222,6 @@ function fixViolations(rootDir, violations, options) {
|
|
|
285
222
|
}
|
|
286
223
|
}
|
|
287
224
|
function isDateValidationResult(object) {
|
|
288
|
-
return 'currentStartYear' in object && '
|
|
225
|
+
return 'currentStartYear' in object && 'expectedEndYear' in object;
|
|
289
226
|
}
|
|
290
227
|
//# sourceMappingURL=check-header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-header.js","sourceRoot":"","sources":["../../src/commands/check-header.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,4BAA4B;AAC5B,yC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AAE,SAAS,CAAC,IAAI,CAAC,CAAC;IAChH,CAAC,CAAC,CAAC;IACH,eAAM,CAAC,OAAO,EAAE,CAAC;IACjB,IAAI,OAAO,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,qDAAqD,CAAC,EAAE;QAC5F,eAAM,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpE,EAAE,CAAC,IAAI,CAAC,WAAW,KAAK,EAAE,EAAE,IAAA,6BAAc,GAAE,CAAC,CAAC;QAC9C,EAAE,CAAC,IAAI,CAAC,kBAAkB,gBAAgB,GAAG,CAAC,CAAC;QAC/C,eAAM,CAAC,OAAO,EAAE,CAAC;KACpB;AACL,CAAC;AAcD,SAAS,sBAAsB,CAAC,MAAwB;IACpD,OAAO,kBAAkB,IAAI,MAAM,IAAI,iBAAiB,IAAI,MAAM,CAAC;AACvE,CAAC"}
|
|
@@ -61,7 +61,7 @@ exports.releaseVscodeIntegration = releaseVscodeIntegration;
|
|
|
61
61
|
function updateExternalGLSPDependencies(version) {
|
|
62
62
|
logger_1.LOGGER.info('Update external GLSP dependencies (Protocol)');
|
|
63
63
|
sh.cd(REPO_ROOT);
|
|
64
|
-
(0, common_1.updateVersion)({ name: '@eclipse-glsp/protocol', version }, { name: '@eclipse-glsp/client', version }, { name: '@eclipse-glsp-examples/workflow-glsp', version }, { name: '@eclipse-glsp-examples/workflow-server', version });
|
|
64
|
+
(0, common_1.updateVersion)({ name: '@eclipse-glsp/protocol', version }, { name: '@eclipse-glsp/client', version }, { name: '@eclipse-glsp-examples/workflow-glsp', version }, { name: '@eclipse-glsp-examples/workflow-server', version }, { name: '@eclipse-glsp-examples/workflow-server-bundled', version });
|
|
65
65
|
}
|
|
66
66
|
function build() {
|
|
67
67
|
logger_1.LOGGER.info('Install & Build with yarn');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-vscode-integration.js","sourceRoot":"","sources":["../../../src/commands/release/release-vscode-integration.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;;;;;;;;;;;AAElF,4CAA8B;AAC9B,8CAA2C;AAC3C,qCASkB;AAElB,IAAI,SAAiB,CAAC;AAEf,KAAK,UAAU,wBAAwB,CAAC,OAAuB;IAClE,eAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;IACvD,eAAM,CAAC,KAAK,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAC3C,SAAS,GAAG,IAAA,sBAAa,EAAC,OAAO,CAAC,CAAC;IACnC,8BAA8B,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,iBAAiB,EAAE,CAAC;IACpB,IAAA,wBAAe,EAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5C,KAAK,EAAE,CAAC;IACR,IAAI,OAAO,CAAC,SAAS,EAAE;QACnB,IAAA,6BAAoB,GAAE,CAAC;KAC1B;IACD,IAAA,qBAAY,EAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACzC,IAAA,gBAAO,EAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAChC,CAAC;AAbD,4DAaC;AAED,SAAS,8BAA8B,CAAC,OAAe;IACnD,eAAM,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;IAC5D,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IACjB,IAAA,sBAAa,EACT,EAAE,IAAI,EAAE,wBAAwB,EAAE,OAAO,EAAE,EAC3C,EAAE,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,EACzC,EAAE,IAAI,EAAE,sCAAsC,EAAE,OAAO,EAAE,EACzD,EAAE,IAAI,EAAE,wCAAwC,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"release-vscode-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AK;IACV,eAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IACzC,IAAA,oBAAW,EAAC,SAAS,CAAC,CAAC;IACvB,eAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,iBAAiB;IACtB,qBAAqB;AACzB,CAAC"}
|
package/lib/util/git-util.d.ts
CHANGED
|
@@ -34,27 +34,7 @@ export declare function getChangesOfLastCommit(path?: string): string[];
|
|
|
34
34
|
* @returns The date or undefined if the file is outside of the git repo.
|
|
35
35
|
*/
|
|
36
36
|
export declare function getLastModificationDate(filePath?: string, repoRoot?: string, excludeMessage?: string): Date | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* Returns the last modification date of a file in a git repo.
|
|
39
|
-
* @param filePath The file
|
|
40
|
-
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
|
|
41
|
-
* @param excludeMessage Only consider commits that don`t match the excludeMessage
|
|
42
|
-
* @returns The date or undefined if the file is outside of the git repo.
|
|
43
|
-
*/
|
|
44
|
-
export declare function getFirstModificationDate(filePath: string, repoRoot?: string, excludeMessage?: string): Date | undefined;
|
|
45
37
|
export declare function getFilesOfCommit(commitHash: string, repoRoot?: string): string[];
|
|
46
|
-
/**
|
|
47
|
-
* Returns the commit hash of the initial commit of the given repository
|
|
48
|
-
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
|
|
49
|
-
* @returns The commit hash or undefined if something went wrong.
|
|
50
|
-
*/
|
|
51
|
-
export declare function getInitialCommit(repoRoot?: string): string | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* Returns the commit hash of the first commit for a given file (across renames).
|
|
54
|
-
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
|
|
55
|
-
* @returns The commit hash or undefined if something went wrong.
|
|
56
|
-
*/
|
|
57
|
-
export declare function getFirstCommit(filePath: string, repoRoot?: string): string | undefined;
|
|
58
38
|
export declare function getLatestGithubRelease(path?: string): string;
|
|
59
39
|
export declare function getLatestTag(path?: string): string;
|
|
60
40
|
export declare function hasBranch(branch: string, path?: string): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-util.d.ts","sourceRoot":"","sources":["../../src/util/git-util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAMlF,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAQtD;AAED,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAIhD;AAED,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAW7D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAO9D;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAQvH;
|
|
1
|
+
{"version":3,"file":"git-util.d.ts","sourceRoot":"","sources":["../../src/util/git-util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAMlF,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAQtD;AAED,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAIhD;AAED,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAW7D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAO9D;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAQvH;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAQhF;AAED,wBAAgB,sBAAsB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED,wBAAgB,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAGlD;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAGhE;AAED,wBAAgB,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAGlD"}
|
package/lib/util/git-util.js
CHANGED
|
@@ -38,7 +38,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
38
38
|
return result;
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.getRemoteUrl = exports.hasBranch = exports.getLatestTag = exports.getLatestGithubRelease = exports.
|
|
41
|
+
exports.getRemoteUrl = exports.hasBranch = exports.getLatestTag = exports.getLatestGithubRelease = exports.getFilesOfCommit = exports.getLastModificationDate = exports.getChangesOfLastCommit = exports.getUncommittedChanges = exports.hasGitChanges = exports.getGitRoot = exports.isGitRepository = void 0;
|
|
42
42
|
const path_1 = require("path");
|
|
43
43
|
const sh = __importStar(require("shelljs"));
|
|
44
44
|
const command_util_1 = require("./command-util");
|
|
@@ -107,28 +107,6 @@ function getLastModificationDate(filePath, repoRoot, excludeMessage) {
|
|
|
107
107
|
return new Date(result.stdout.trim());
|
|
108
108
|
}
|
|
109
109
|
exports.getLastModificationDate = getLastModificationDate;
|
|
110
|
-
/**
|
|
111
|
-
* Returns the last modification date of a file in a git repo.
|
|
112
|
-
* @param filePath The file
|
|
113
|
-
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
|
|
114
|
-
* @param excludeMessage Only consider commits that don`t match the excludeMessage
|
|
115
|
-
* @returns The date or undefined if the file is outside of the git repo.
|
|
116
|
-
*/
|
|
117
|
-
function getFirstModificationDate(filePath, repoRoot, excludeMessage) {
|
|
118
|
-
cdIfPresent(repoRoot);
|
|
119
|
-
const additionalArgs = excludeMessage ? `--grep="${excludeMessage}" --invert-grep` : '';
|
|
120
|
-
const result = sh.exec(`git log ${additionalArgs} --pretty="format:%ci" --follow ${filePath}`, (0, command_util_1.getShellConfig)());
|
|
121
|
-
if (result.code !== 0) {
|
|
122
|
-
return undefined;
|
|
123
|
-
}
|
|
124
|
-
const datesString = result.stdout.trim();
|
|
125
|
-
if (datesString.length === 0) {
|
|
126
|
-
return new Date();
|
|
127
|
-
}
|
|
128
|
-
const date = datesString.split('\n').pop();
|
|
129
|
-
return date ? new Date(date) : undefined;
|
|
130
|
-
}
|
|
131
|
-
exports.getFirstModificationDate = getFirstModificationDate;
|
|
132
110
|
function getFilesOfCommit(commitHash, repoRoot) {
|
|
133
111
|
cdIfPresent(repoRoot);
|
|
134
112
|
const result = sh.exec(`git show --pretty="" --name-only ${commitHash}`, (0, command_util_1.getShellConfig)());
|
|
@@ -138,38 +116,6 @@ function getFilesOfCommit(commitHash, repoRoot) {
|
|
|
138
116
|
return result.stdout.trim().split('\n');
|
|
139
117
|
}
|
|
140
118
|
exports.getFilesOfCommit = getFilesOfCommit;
|
|
141
|
-
/**
|
|
142
|
-
* Returns the commit hash of the initial commit of the given repository
|
|
143
|
-
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
|
|
144
|
-
* @returns The commit hash or undefined if something went wrong.
|
|
145
|
-
*/
|
|
146
|
-
function getInitialCommit(repoRoot) {
|
|
147
|
-
cdIfPresent(repoRoot);
|
|
148
|
-
const result = sh.exec('git log --pretty=oneline --reverse', (0, command_util_1.getShellConfig)());
|
|
149
|
-
if (result.code !== 0) {
|
|
150
|
-
return undefined;
|
|
151
|
-
}
|
|
152
|
-
const commits = result.stdout.trim();
|
|
153
|
-
if (commits.length === 0) {
|
|
154
|
-
return undefined;
|
|
155
|
-
}
|
|
156
|
-
return commits.substring(0, commits.indexOf(' '));
|
|
157
|
-
}
|
|
158
|
-
exports.getInitialCommit = getInitialCommit;
|
|
159
|
-
/**
|
|
160
|
-
* Returns the commit hash of the first commit for a given file (across renames).
|
|
161
|
-
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
|
|
162
|
-
* @returns The commit hash or undefined if something went wrong.
|
|
163
|
-
*/
|
|
164
|
-
function getFirstCommit(filePath, repoRoot) {
|
|
165
|
-
cdIfPresent(repoRoot);
|
|
166
|
-
const result = sh.exec(`git log --follow --pretty=format:"%H" ${filePath}`, (0, command_util_1.getShellConfig)());
|
|
167
|
-
if (result.code !== 0) {
|
|
168
|
-
return undefined;
|
|
169
|
-
}
|
|
170
|
-
return result.stdout.trim().split('\n').pop();
|
|
171
|
-
}
|
|
172
|
-
exports.getFirstCommit = getFirstCommit;
|
|
173
119
|
function getLatestGithubRelease(path) {
|
|
174
120
|
cdIfPresent(path);
|
|
175
121
|
const release = sh.exec('gh release list --exclude-drafts -L 1', (0, command_util_1.getShellConfig)()).stdout.trim().split('\t');
|
package/lib/util/git-util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-util.js","sourceRoot":"","sources":["../../src/util/git-util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;;;;;;;;;;;AAElF,+BAA+B;AAC/B,4CAA8B;AAC9B,iDAAgD;AAEhD,SAAgB,eAAe,CAAC,IAAa;IACzC,WAAW,CAAC,IAAI,CAAC,CAAC;IAClB,MAAM,SAAS,GACX,EAAE;SACG,IAAI,CAAC,qCAAqC,EAAE,IAAA,6BAAc,EAAC,EAAE,MAAM,EAAE,IAAI,EAA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I Tooling & scripts for GLSP components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"shelljs": "^0.8.5"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@eclipse-glsp/config": "2.
|
|
52
|
+
"@eclipse-glsp/config": "2.2.0-next.886d2d0.156+886d2d0",
|
|
53
53
|
"@types/glob": "^8.1.0",
|
|
54
54
|
"@types/node-fetch": "^2.6.6",
|
|
55
55
|
"@types/readline-sync": "^1.4.5",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "886d2d02687e28a6a6c243b96449f31b738a3c4e"
|
|
63
63
|
}
|
|
@@ -21,14 +21,7 @@ import * as minimatch from 'minimatch';
|
|
|
21
21
|
import * as readline from 'readline-sync';
|
|
22
22
|
import * as sh from 'shelljs';
|
|
23
23
|
import { baseCommand, configureShell, getShellConfig } from '../util/command-util';
|
|
24
|
-
import {
|
|
25
|
-
getChangesOfLastCommit,
|
|
26
|
-
getFirstCommit,
|
|
27
|
-
getFirstModificationDate,
|
|
28
|
-
getInitialCommit,
|
|
29
|
-
getLastModificationDate,
|
|
30
|
-
getUncommittedChanges
|
|
31
|
-
} from '../util/git-util';
|
|
24
|
+
import { getChangesOfLastCommit, getLastModificationDate, getUncommittedChanges } from '../util/git-util';
|
|
32
25
|
|
|
33
26
|
import { LOGGER } from '../util/logger';
|
|
34
27
|
import { validateGitDirectory } from '../util/validation-util';
|
|
@@ -40,24 +33,19 @@ export interface HeaderCheckOptions {
|
|
|
40
33
|
json: boolean;
|
|
41
34
|
excludeDefaults: boolean;
|
|
42
35
|
autoFix: boolean;
|
|
43
|
-
severity: Severity;
|
|
44
36
|
}
|
|
45
37
|
|
|
46
38
|
const checkTypes = ['full', 'changes', 'lastCommit'] as const;
|
|
47
|
-
type CheckType = typeof checkTypes[number];
|
|
48
|
-
|
|
49
|
-
const severityTypes = ['error', 'warn', 'ok'] as const;
|
|
50
|
-
|
|
51
|
-
type Severity = typeof severityTypes[number];
|
|
39
|
+
type CheckType = (typeof checkTypes)[number];
|
|
52
40
|
|
|
53
41
|
const DEFAULT_EXCLUDES = ['**/@(node_modules|lib|dist|bundle)/**'];
|
|
54
|
-
const YEAR_RANGE_REGEX = /\d{4}
|
|
55
|
-
const HEADER_PATTERN = 'Copyright \\([cC]\\) \\d{4}
|
|
42
|
+
const YEAR_RANGE_REGEX = /\d{4}/g;
|
|
43
|
+
const HEADER_PATTERN = 'Copyright \\([cC]\\) \\d{4}';
|
|
56
44
|
const AUTO_FIX_MESSAGE = 'Fix copyright header violations';
|
|
57
45
|
|
|
58
46
|
export const CheckHeaderCommand = baseCommand() //
|
|
59
47
|
.name('checkHeaders')
|
|
60
|
-
.description('Validates the copyright year range of license header files')
|
|
48
|
+
.description('Validates the copyright year range (end year) of license header files')
|
|
61
49
|
.argument('<rootDir>', 'The starting directory for the check', validateGitDirectory)
|
|
62
50
|
.addOption(
|
|
63
51
|
new Option(
|
|
@@ -80,11 +68,6 @@ export const CheckHeaderCommand = baseCommand() //
|
|
|
80
68
|
'Disables the default excludes patterns. Only explicitly passed exclude patterns (-e, --exclude) are considered'
|
|
81
69
|
)
|
|
82
70
|
.option('-j, --json', 'Also persist validation results as json file', false)
|
|
83
|
-
.addOption(
|
|
84
|
-
new Option('-s, --severity <severity>', 'The severity of validation results that should be printed.')
|
|
85
|
-
.choices(severityTypes)
|
|
86
|
-
.default('error', '"error" (only)')
|
|
87
|
-
)
|
|
88
71
|
.option('-a, --autoFix', 'Auto apply & commit fixes without prompting the user', false)
|
|
89
72
|
.action(checkHeaders);
|
|
90
73
|
|
|
@@ -127,17 +110,11 @@ function getFiles(rootDir: string, options: HeaderCheckOptions): string[] {
|
|
|
127
110
|
}
|
|
128
111
|
|
|
129
112
|
function validate(rootDir: string, files: string[], options: HeaderCheckOptions): ValidationResult[] {
|
|
130
|
-
// Derives all files with valid headers
|
|
113
|
+
// Derives all files with valid headers and all files with no or invalid headers
|
|
131
114
|
const filesWithHeader = sh.grep('-l', HEADER_PATTERN, files).stdout.trim().split('\n');
|
|
132
|
-
const copyrightYears = sh
|
|
133
|
-
.grep(HEADER_PATTERN, files)
|
|
134
|
-
.stdout.trim()
|
|
135
|
-
.split('\n')
|
|
136
|
-
.map(line => line.match(YEAR_RANGE_REGEX)!.map(string => Number.parseInt(string, 10)));
|
|
137
115
|
const noHeaders = files.filter(file => !filesWithHeader.includes(file));
|
|
138
116
|
|
|
139
117
|
const results: ValidationResult[] = [];
|
|
140
|
-
|
|
141
118
|
const allFilesLength = files.length;
|
|
142
119
|
|
|
143
120
|
// Create validation results for all files with no or invalid headers
|
|
@@ -147,7 +124,7 @@ function validate(rootDir: string, files: string[], options: HeaderCheckOptions)
|
|
|
147
124
|
}
|
|
148
125
|
noHeaders.forEach((file, i) => {
|
|
149
126
|
printFileProgress(i + 1, allFilesLength, `Validating ${file}`);
|
|
150
|
-
results.push({ file: path.resolve(rootDir, file), violation: 'noOrMissingHeader'
|
|
127
|
+
results.push({ file: path.resolve(rootDir, file), violation: 'noOrMissingHeader' });
|
|
151
128
|
});
|
|
152
129
|
|
|
153
130
|
// Performance optimization: avoid retrieving the dates for each individual file by precalculating the endYear if possible.
|
|
@@ -161,22 +138,20 @@ function validate(rootDir: string, files: string[], options: HeaderCheckOptions)
|
|
|
161
138
|
// Create validation results for all files with valid headers
|
|
162
139
|
filesWithHeader.forEach((file, i) => {
|
|
163
140
|
printFileProgress(i + 1 + noHeadersLength, allFilesLength, `Validating ${file}`);
|
|
164
|
-
|
|
141
|
+
const copyrightLine = sh.head({ '-n': 2 }, file).stdout.trim().split('\n')[1];
|
|
142
|
+
const copyRightYears = copyrightLine.match(YEAR_RANGE_REGEX)!;
|
|
143
|
+
const currentStartYear = Number.parseInt(copyRightYears[0], 10);
|
|
144
|
+
const currentEndYear = copyRightYears[1] ? Number.parseInt(copyRightYears[1], 10) : undefined;
|
|
165
145
|
const result: DateValidationResult = {
|
|
166
|
-
currentStartYear
|
|
167
|
-
|
|
168
|
-
currentEndYear: copyrightYears[i].shift(),
|
|
146
|
+
currentStartYear,
|
|
147
|
+
currentEndYear,
|
|
169
148
|
expectedEndYear: defaultEndYear ?? getLastModificationDate(file, rootDir, AUTO_FIX_MESSAGE)!.getFullYear(),
|
|
170
149
|
file,
|
|
171
|
-
severity: 'ok',
|
|
172
150
|
violation: 'none'
|
|
173
151
|
};
|
|
174
152
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
} else {
|
|
178
|
-
validateTimePeriod(result);
|
|
179
|
-
}
|
|
153
|
+
validateEndYear(result);
|
|
154
|
+
|
|
180
155
|
results.push(result);
|
|
181
156
|
});
|
|
182
157
|
|
|
@@ -186,57 +161,16 @@ function validate(rootDir: string, files: string[], options: HeaderCheckOptions)
|
|
|
186
161
|
return results;
|
|
187
162
|
}
|
|
188
163
|
|
|
189
|
-
function
|
|
190
|
-
const { currentStartYear,
|
|
191
|
-
result.violation = '
|
|
192
|
-
result.severity = 'error';
|
|
193
|
-
|
|
194
|
-
if (!currentEndYear) {
|
|
195
|
-
if (currentStartYear === expectedStartYear) {
|
|
196
|
-
result.violation = 'none';
|
|
197
|
-
result.severity = 'ok';
|
|
198
|
-
}
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
// Cornercase: For files of the initial contribution the copyright header predates the first git modification date.
|
|
203
|
-
// => declare as warning if not part of the initial contribution.
|
|
204
|
-
if (expectedStartYear === currentEndYear && currentStartYear < expectedStartYear) {
|
|
205
|
-
if (getFirstCommit(result.file) === getInitialCommit()) {
|
|
206
|
-
result.violation = 'none';
|
|
207
|
-
result.severity = 'ok';
|
|
208
|
-
} else {
|
|
209
|
-
result.severity = 'warn';
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
function validateTimePeriod(result: DateValidationResult): void {
|
|
215
|
-
const { currentStartYear, expectedStartYear, expectedEndYear, currentEndYear } = result;
|
|
164
|
+
function validateEndYear(result: DateValidationResult): void {
|
|
165
|
+
const { currentStartYear, expectedEndYear, currentEndYear } = result;
|
|
166
|
+
result.violation = 'invalidEndYear';
|
|
216
167
|
|
|
217
|
-
|
|
218
|
-
result.severity = 'error';
|
|
219
|
-
if (!currentEndYear) {
|
|
220
|
-
result.severity = 'error';
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
168
|
+
const valid = currentEndYear ? currentEndYear === expectedEndYear : currentStartYear === expectedEndYear;
|
|
223
169
|
|
|
224
|
-
if (
|
|
170
|
+
if (valid) {
|
|
225
171
|
result.violation = 'none';
|
|
226
|
-
result.severity = 'ok';
|
|
227
172
|
return;
|
|
228
173
|
}
|
|
229
|
-
|
|
230
|
-
// Cornercase: For files of the initial contribution the copyright header predates the first git modification date.
|
|
231
|
-
// => declare as warning if not part of the initial contribution.
|
|
232
|
-
if (currentEndYear === expectedEndYear && currentStartYear < expectedEndYear) {
|
|
233
|
-
if (getFirstCommit(result.file) === getInitialCommit()) {
|
|
234
|
-
result.violation = 'none';
|
|
235
|
-
result.severity = 'ok';
|
|
236
|
-
} else {
|
|
237
|
-
result.severity = 'warn';
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
174
|
}
|
|
241
175
|
|
|
242
176
|
function printFileProgress(currentFileCount: number, maxFileCount: number, message: string, clear = true): void {
|
|
@@ -253,14 +187,9 @@ function printFileProgress(currentFileCount: number, maxFileCount: number, messa
|
|
|
253
187
|
export function handleValidationResults(rootDir: string, results: ValidationResult[], options: HeaderCheckOptions): void {
|
|
254
188
|
LOGGER.newLine();
|
|
255
189
|
LOGGER.info(`Header validation for ${results.length} files completed`);
|
|
256
|
-
const violations = results.filter(result => result.
|
|
190
|
+
const violations = results.filter(result => result.violation !== 'none');
|
|
257
191
|
// Adjust results to print based on configured severity level
|
|
258
|
-
|
|
259
|
-
if (options.severity === 'error') {
|
|
260
|
-
toPrint = violations;
|
|
261
|
-
} else if (options.severity === 'warn') {
|
|
262
|
-
toPrint = results.filter(result => result.severity !== 'ok');
|
|
263
|
-
}
|
|
192
|
+
const toPrint = violations;
|
|
264
193
|
|
|
265
194
|
LOGGER.info(`Found ${toPrint.length} copyright header violations:`);
|
|
266
195
|
LOGGER.newLine();
|
|
@@ -274,9 +203,7 @@ export function handleValidationResults(rootDir: string, results: ValidationResu
|
|
|
274
203
|
}
|
|
275
204
|
|
|
276
205
|
if (violations.length > 0 && (options.autoFix || readline.keyInYN('Do you want automatically fix copyright year range violations?'))) {
|
|
277
|
-
const toFix = violations.filter(
|
|
278
|
-
violation => violation.severity === 'error' && isDateValidationResult(violation)
|
|
279
|
-
) as DateValidationResult[];
|
|
206
|
+
const toFix = violations.filter(violation => isDateValidationResult(violation)) as DateValidationResult[];
|
|
280
207
|
fixViolations(rootDir, toFix, options);
|
|
281
208
|
}
|
|
282
209
|
|
|
@@ -284,43 +211,33 @@ export function handleValidationResults(rootDir: string, results: ValidationResu
|
|
|
284
211
|
}
|
|
285
212
|
|
|
286
213
|
function toPrintMessage(result: ValidationResult): string {
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
const expected =
|
|
298
|
-
result.expectedStartYear !== result.expectedEndYear
|
|
299
|
-
? `${result.expectedStartYear}-${result.expectedEndYear}`
|
|
300
|
-
: result.expectedStartYear.toString();
|
|
301
|
-
const actual = result.currentEndYear ? `${result.currentStartYear}-${result.currentEndYear}` : result.currentStartYear.toString();
|
|
302
|
-
const message = result.violation === 'incorrectCopyrightPeriod' ? 'Invalid copyright period' : 'Invalid copyright year';
|
|
303
|
-
return `${colors[result.severity]} ${message}! Expected '${expected}' but is '${actual}'`;
|
|
214
|
+
const error = '\x1b[31m';
|
|
215
|
+
const info = '\x1b[32m';
|
|
216
|
+
|
|
217
|
+
if (isDateValidationResult(result) && result.violation === 'invalidEndYear') {
|
|
218
|
+
const expected = result.expectedEndYear.toString();
|
|
219
|
+
const actual = result.currentEndYear
|
|
220
|
+
? `${result.currentEndYear} (${result.currentStartYear}-${result.currentEndYear})`
|
|
221
|
+
: result.currentStartYear.toString();
|
|
222
|
+
const message = 'Invalid copyright end year';
|
|
223
|
+
return `${error} ${message}! Expected end year '${expected}' but is '${actual}'`;
|
|
304
224
|
} else if (result.violation === 'noOrMissingHeader') {
|
|
305
|
-
return `${
|
|
225
|
+
return `${error} No or invalid copyright header!`;
|
|
306
226
|
}
|
|
307
227
|
|
|
308
|
-
return `${
|
|
228
|
+
return `${info} OK`;
|
|
309
229
|
}
|
|
310
230
|
|
|
311
231
|
function fixViolations(rootDir: string, violations: DateValidationResult[], options: HeaderCheckOptions): void {
|
|
312
232
|
LOGGER.newLine();
|
|
313
233
|
violations.forEach((violation, i) => {
|
|
314
234
|
printFileProgress(i + 1, violations.length, `Fix ${violation.file}`, false);
|
|
315
|
-
const fixedStartYear =
|
|
316
|
-
violation.currentStartYear < violation.expectedStartYear ? violation.currentStartYear : violation.expectedStartYear;
|
|
317
235
|
|
|
318
236
|
const currentRange = `${violation.currentStartYear}${violation.currentEndYear ? '-' + violation.currentEndYear : ''}`;
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}
|
|
237
|
+
const fixedRange =
|
|
238
|
+
violation.currentEndYear || violation.currentStartYear < violation.expectedEndYear
|
|
239
|
+
? `${violation.currentStartYear}-${violation.expectedEndYear}`
|
|
240
|
+
: `${violation.expectedEndYear}`;
|
|
324
241
|
|
|
325
242
|
sh.sed('-i', RegExp('Copyright \\([cC]\\) ' + currentRange), `Copyright (c) ${fixedRange}`, violation.file);
|
|
326
243
|
});
|
|
@@ -337,19 +254,17 @@ function fixViolations(rootDir: string, violations: DateValidationResult[], opti
|
|
|
337
254
|
// Helper types
|
|
338
255
|
interface ValidationResult {
|
|
339
256
|
file: string;
|
|
340
|
-
severity: Severity;
|
|
341
257
|
violation: Violation;
|
|
342
258
|
}
|
|
343
259
|
|
|
344
260
|
interface DateValidationResult extends ValidationResult {
|
|
345
261
|
currentStartYear: number;
|
|
346
|
-
expectedStartYear: number;
|
|
347
262
|
currentEndYear?: number;
|
|
348
263
|
expectedEndYear: number;
|
|
349
264
|
}
|
|
350
265
|
|
|
351
266
|
function isDateValidationResult(object: ValidationResult): object is DateValidationResult {
|
|
352
|
-
return 'currentStartYear' in object && '
|
|
267
|
+
return 'currentStartYear' in object && 'expectedEndYear' in object;
|
|
353
268
|
}
|
|
354
269
|
|
|
355
|
-
type Violation = 'none' | 'noOrMissingHeader' | '
|
|
270
|
+
type Violation = 'none' | 'noOrMissingHeader' | 'invalidEndYear';
|
|
@@ -51,7 +51,8 @@ function updateExternalGLSPDependencies(version: string): void {
|
|
|
51
51
|
{ name: '@eclipse-glsp/protocol', version },
|
|
52
52
|
{ name: '@eclipse-glsp/client', version },
|
|
53
53
|
{ name: '@eclipse-glsp-examples/workflow-glsp', version },
|
|
54
|
-
{ name: '@eclipse-glsp-examples/workflow-server', version }
|
|
54
|
+
{ name: '@eclipse-glsp-examples/workflow-server', version },
|
|
55
|
+
{ name: '@eclipse-glsp-examples/workflow-server-bundled', version }
|
|
55
56
|
);
|
|
56
57
|
}
|
|
57
58
|
|
package/src/util/git-util.ts
CHANGED
|
@@ -84,28 +84,6 @@ export function getLastModificationDate(filePath?: string, repoRoot?: string, ex
|
|
|
84
84
|
}
|
|
85
85
|
return new Date(result.stdout.trim());
|
|
86
86
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Returns the last modification date of a file in a git repo.
|
|
89
|
-
* @param filePath The file
|
|
90
|
-
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
|
|
91
|
-
* @param excludeMessage Only consider commits that don`t match the excludeMessage
|
|
92
|
-
* @returns The date or undefined if the file is outside of the git repo.
|
|
93
|
-
*/
|
|
94
|
-
export function getFirstModificationDate(filePath: string, repoRoot?: string, excludeMessage?: string): Date | undefined {
|
|
95
|
-
cdIfPresent(repoRoot);
|
|
96
|
-
const additionalArgs = excludeMessage ? `--grep="${excludeMessage}" --invert-grep` : '';
|
|
97
|
-
const result = sh.exec(`git log ${additionalArgs} --pretty="format:%ci" --follow ${filePath}`, getShellConfig());
|
|
98
|
-
if (result.code !== 0) {
|
|
99
|
-
return undefined;
|
|
100
|
-
}
|
|
101
|
-
const datesString = result.stdout.trim();
|
|
102
|
-
if (datesString.length === 0) {
|
|
103
|
-
return new Date();
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const date = datesString.split('\n').pop();
|
|
107
|
-
return date ? new Date(date) : undefined;
|
|
108
|
-
}
|
|
109
87
|
|
|
110
88
|
export function getFilesOfCommit(commitHash: string, repoRoot?: string): string[] {
|
|
111
89
|
cdIfPresent(repoRoot);
|
|
@@ -117,38 +95,6 @@ export function getFilesOfCommit(commitHash: string, repoRoot?: string): string[
|
|
|
117
95
|
return result.stdout.trim().split('\n');
|
|
118
96
|
}
|
|
119
97
|
|
|
120
|
-
/**
|
|
121
|
-
* Returns the commit hash of the initial commit of the given repository
|
|
122
|
-
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
|
|
123
|
-
* @returns The commit hash or undefined if something went wrong.
|
|
124
|
-
*/
|
|
125
|
-
export function getInitialCommit(repoRoot?: string): string | undefined {
|
|
126
|
-
cdIfPresent(repoRoot);
|
|
127
|
-
const result = sh.exec('git log --pretty=oneline --reverse', getShellConfig());
|
|
128
|
-
if (result.code !== 0) {
|
|
129
|
-
return undefined;
|
|
130
|
-
}
|
|
131
|
-
const commits = result.stdout.trim();
|
|
132
|
-
if (commits.length === 0) {
|
|
133
|
-
return undefined;
|
|
134
|
-
}
|
|
135
|
-
return commits.substring(0, commits.indexOf(' '));
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Returns the commit hash of the first commit for a given file (across renames).
|
|
140
|
-
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
|
|
141
|
-
* @returns The commit hash or undefined if something went wrong.
|
|
142
|
-
*/
|
|
143
|
-
export function getFirstCommit(filePath: string, repoRoot?: string): string | undefined {
|
|
144
|
-
cdIfPresent(repoRoot);
|
|
145
|
-
const result = sh.exec(`git log --follow --pretty=format:"%H" ${filePath}`, getShellConfig());
|
|
146
|
-
if (result.code !== 0) {
|
|
147
|
-
return undefined;
|
|
148
|
-
}
|
|
149
|
-
return result.stdout.trim().split('\n').pop();
|
|
150
|
-
}
|
|
151
|
-
|
|
152
98
|
export function getLatestGithubRelease(path?: string): string {
|
|
153
99
|
cdIfPresent(path);
|
|
154
100
|
const release = sh.exec('gh release list --exclude-drafts -L 1', getShellConfig()).stdout.trim().split('\t');
|