@eclipse-glsp/cli 2.1.0-next.de11704.146 → 2.2.0-next.063af47.158

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.
Files changed (82) hide show
  1. package/README.md +40 -0
  2. package/bin/glsp +1 -1
  3. package/lib/app.d.ts.map +1 -1
  4. package/lib/app.js +14 -13
  5. package/lib/app.js.map +1 -1
  6. package/lib/commands/check-header.d.ts +3 -6
  7. package/lib/commands/check-header.d.ts.map +1 -1
  8. package/lib/commands/check-header.js +85 -166
  9. package/lib/commands/check-header.js.map +1 -1
  10. package/lib/commands/coverage-report.js +19 -48
  11. package/lib/commands/coverage-report.js.map +1 -1
  12. package/lib/commands/generate-index.d.ts +38 -0
  13. package/lib/commands/generate-index.d.ts.map +1 -0
  14. package/lib/commands/generate-index.js +130 -0
  15. package/lib/commands/generate-index.js.map +1 -0
  16. package/lib/commands/release/common.d.ts +2 -3
  17. package/lib/commands/release/common.d.ts.map +1 -1
  18. package/lib/commands/release/common.js +78 -126
  19. package/lib/commands/release/common.js.map +1 -1
  20. package/lib/commands/release/release-client.d.ts +1 -1
  21. package/lib/commands/release/release-client.d.ts.map +1 -1
  22. package/lib/commands/release/release-client.js +23 -46
  23. package/lib/commands/release/release-client.js.map +1 -1
  24. package/lib/commands/release/release-eclipse-integration.d.ts +1 -1
  25. package/lib/commands/release/release-eclipse-integration.d.ts.map +1 -1
  26. package/lib/commands/release/release-eclipse-integration.js +32 -59
  27. package/lib/commands/release/release-eclipse-integration.js.map +1 -1
  28. package/lib/commands/release/release-java-server.d.ts +1 -1
  29. package/lib/commands/release/release-java-server.d.ts.map +1 -1
  30. package/lib/commands/release/release-java-server.js +25 -52
  31. package/lib/commands/release/release-java-server.js.map +1 -1
  32. package/lib/commands/release/release-server-node.d.ts +1 -1
  33. package/lib/commands/release/release-server-node.d.ts.map +1 -1
  34. package/lib/commands/release/release-server-node.js +16 -43
  35. package/lib/commands/release/release-server-node.js.map +1 -1
  36. package/lib/commands/release/release-theia-integration.d.ts +1 -1
  37. package/lib/commands/release/release-theia-integration.d.ts.map +1 -1
  38. package/lib/commands/release/release-theia-integration.js +16 -43
  39. package/lib/commands/release/release-theia-integration.js.map +1 -1
  40. package/lib/commands/release/release-vscode-integration.d.ts +1 -1
  41. package/lib/commands/release/release-vscode-integration.d.ts.map +1 -1
  42. package/lib/commands/release/release-vscode-integration.js +16 -43
  43. package/lib/commands/release/release-vscode-integration.js.map +1 -1
  44. package/lib/commands/release/release.d.ts +1 -1
  45. package/lib/commands/release/release.d.ts.map +1 -1
  46. package/lib/commands/release/release.js +61 -88
  47. package/lib/commands/release/release.js.map +1 -1
  48. package/lib/commands/update-next.d.ts +20 -0
  49. package/lib/commands/update-next.d.ts.map +1 -0
  50. package/lib/commands/update-next.js +116 -0
  51. package/lib/commands/update-next.js.map +1 -0
  52. package/lib/util/command-util.d.ts +1 -1
  53. package/lib/util/command-util.d.ts.map +1 -1
  54. package/lib/util/command-util.js +10 -40
  55. package/lib/util/command-util.js.map +1 -1
  56. package/lib/util/git-util.d.ts +0 -20
  57. package/lib/util/git-util.d.ts.map +1 -1
  58. package/lib/util/git-util.js +27 -118
  59. package/lib/util/git-util.js.map +1 -1
  60. package/lib/util/logger.js +2 -6
  61. package/lib/util/logger.js.map +1 -1
  62. package/lib/util/validation-util.d.ts +0 -1
  63. package/lib/util/validation-util.d.ts.map +1 -1
  64. package/lib/util/validation-util.js +21 -52
  65. package/lib/util/validation-util.js.map +1 -1
  66. package/package.json +6 -3
  67. package/src/app.ts +9 -5
  68. package/src/commands/check-header.ts +63 -138
  69. package/src/commands/coverage-report.ts +4 -4
  70. package/src/commands/generate-index.ts +154 -0
  71. package/src/commands/release/common.ts +7 -13
  72. package/src/commands/release/release-client.ts +11 -16
  73. package/src/commands/release/release-eclipse-integration.ts +6 -6
  74. package/src/commands/release/release-java-server.ts +4 -4
  75. package/src/commands/release/release-server-node.ts +3 -3
  76. package/src/commands/release/release-theia-integration.ts +3 -3
  77. package/src/commands/release/release-vscode-integration.ts +5 -4
  78. package/src/commands/release/release.ts +12 -12
  79. package/src/commands/update-next.ts +129 -0
  80. package/src/util/command-util.ts +1 -1
  81. package/src/util/git-util.ts +2 -56
  82. package/src/util/validation-util.ts +2 -3
package/README.md CHANGED
@@ -83,6 +83,46 @@ Options:
83
83
  -h, --help display help for command
84
84
  ```
85
85
 
86
+ ## updateNext
87
+
88
+ ```console
89
+ $ glsp updateNext -h
90
+ Usage: glsp updateNext|u [options] [rootDir]
91
+
92
+ Updates all `next` dependencies in GLSP project to the latest version
93
+
94
+ Arguments:
95
+ rootDir The repository root (default: "<cwd>")
96
+
97
+ Options:
98
+ -v, --verbose Enable verbose (debug) log output (default: false)
99
+ -h, --help display help for command
100
+ ```
101
+
102
+ ## generateIndex
103
+
104
+ Use this command to create an index file of all sources for a given directory and all it's sub directories.
105
+
106
+ ```console
107
+ $ glsp generateIndex -h
108
+ Usage: glsp generateIndex [options] <rootDir>
109
+
110
+ Generate index files in a given source directory.
111
+
112
+ Arguments:
113
+ rootDir The source directory for index generation.
114
+
115
+ Options:
116
+ -s, --singleIndex Generate a single index file in the source directory instead of indices in each sub-directory (default: false)
117
+ -f, --forceOverwrite Overwrite existing index files and remove them if there are no entries (default: false)
118
+ -m, --match [match patterns...] File patterns to consider during indexing (default: ["**/*.ts","**/*.tsx"])
119
+ -i, --ignore [ignore patterns...] File patterns to ignore during indexing (default: ["**/*.spec.ts","**/*.spec.tsx","**/*.d.ts"])
120
+ -s, --style <importStyle> Import Style (choices: "commonjs", "esm", default: "commonjs")
121
+ --ignoreFile <ignoreFile> The file that is used to specify patterns that should be ignored during indexing (default: ".indexignore")
122
+ -v, --verbose Generate verbose output during generation (default: false)
123
+ -h, --help display help for command
124
+ ```
125
+
86
126
  ## More information
87
127
 
88
128
  For more information, please visit the [Eclipse GLSP Umbrella repository](https://github.com/eclipse-glsp/glsp) and the [Eclipse GLSP Website](https://www.eclipse.org/glsp/).
package/bin/glsp CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- require('../lib/app.js');
2
+ import('../lib/app.js');
package/lib/app.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":";AAqBA,eAAO,MAAM,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":";AAuBA,eAAO,MAAM,eAAe,eAAe,CAAC"}
package/lib/app.js CHANGED
@@ -1,7 +1,4 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.COMMAND_VERSION = void 0;
5
2
  /********************************************************************************
6
3
  * Copyright (c) 2022 EclipseSource and others.
7
4
  *
@@ -17,16 +14,20 @@ exports.COMMAND_VERSION = void 0;
17
14
  *
18
15
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
19
16
  ********************************************************************************/
20
- const check_header_1 = require("./commands/check-header");
21
- const coverage_report_1 = require("./commands/coverage-report");
22
- const release_1 = require("./commands/release/release");
23
- const command_util_1 = require("./util/command-util");
24
- exports.COMMAND_VERSION = '1.1.0-next';
25
- const app = (0, command_util_1.baseCommand)() //
26
- .version(exports.COMMAND_VERSION)
17
+ import { CheckHeaderCommand } from './commands/check-header.js';
18
+ import { CoverageReportCommand } from './commands/coverage-report.js';
19
+ import { GenerateIndex } from './commands/generate-index.js';
20
+ import { ReleaseCommand } from './commands/release/release.js';
21
+ import { UpdateNextCommand } from './commands/update-next.js';
22
+ import { baseCommand } from './util/command-util.js';
23
+ export const COMMAND_VERSION = '1.1.0-next';
24
+ const app = baseCommand() //
25
+ .version(COMMAND_VERSION)
27
26
  .name('glsp')
28
- .addCommand(coverage_report_1.CoverageReportCommand)
29
- .addCommand(release_1.ReleaseCommand)
30
- .addCommand(check_header_1.CheckHeaderCommand);
27
+ .addCommand(CoverageReportCommand)
28
+ .addCommand(ReleaseCommand)
29
+ .addCommand(CheckHeaderCommand)
30
+ .addCommand(UpdateNextCommand)
31
+ .addCommand(GenerateIndex);
31
32
  app.parse(process.argv);
32
33
  //# sourceMappingURL=app.js.map
package/lib/app.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":";;;;AACA;;;;;;;;;;;;;;kFAckF;AAClF,0DAA6D;AAC7D,gEAAmE;AACnE,wDAA4D;AAC5D,sDAAkD;AAErC,QAAA,eAAe,GAAG,YAAY,CAAC;AAE5C,MAAM,GAAG,GAAG,IAAA,0BAAW,GAAE,CAAC,EAAE;KACvB,OAAO,CAAC,uBAAe,CAAC;KACxB,IAAI,CAAC,MAAM,CAAC;KACZ,UAAU,CAAC,uCAAqB,CAAC;KACjC,UAAU,CAAC,wBAAc,CAAC;KAC1B,UAAU,CAAC,iCAAkB,CAAC,CAAC;AAEpC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC;AAE5C,MAAM,GAAG,GAAG,WAAW,EAAE,CAAC,EAAE;KACvB,OAAO,CAAC,eAAe,CAAC;KACxB,IAAI,CAAC,MAAM,CAAC;KACZ,UAAU,CAAC,qBAAqB,CAAC;KACjC,UAAU,CAAC,cAAc,CAAC;KAC1B,UAAU,CAAC,kBAAkB,CAAC;KAC9B,UAAU,CAAC,iBAAiB,CAAC;KAC7B,UAAU,CAAC,aAAa,CAAC,CAAC;AAE/B,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -5,20 +5,17 @@ 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;
17
+ line?: string;
21
18
  }
22
- type Violation = 'none' | 'noOrMissingHeader' | 'incorrectCopyrightPeriod' | 'invalidCopyrightYear';
19
+ type Violation = 'none' | 'noOrMissingHeader' | 'invalidEndYear' | 'noYear';
23
20
  export {};
24
21
  //# 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":"AAmCA,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;IACjB,QAAQ,EAAE,QAAQ,CAAC;CACtB;AAED,QAAA,MAAM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AAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI,CA2BvH;AA8CD,UAAU,gBAAgB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAYD,KAAK,SAAS,GAAG,MAAM,GAAG,mBAAmB,GAAG,gBAAgB,GAAG,QAAQ,CAAC"}
@@ -1,29 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.handleValidationResults = exports.checkHeaders = exports.CheckHeaderCommand = void 0;
27
1
  /********************************************************************************
28
2
  * Copyright (c) 2022-2023 EclipseSource and others.
29
3
  *
@@ -40,66 +14,61 @@ exports.handleValidationResults = exports.checkHeaders = exports.CheckHeaderComm
40
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
41
15
  ********************************************************************************/
42
16
  /* eslint-disable max-len */
43
- const commander_1 = require("commander");
44
- const fs = __importStar(require("fs"));
45
- const glob_1 = require("glob");
46
- const minimatch = __importStar(require("minimatch"));
47
- const readline = __importStar(require("readline-sync"));
48
- const sh = __importStar(require("shelljs"));
49
- const command_util_1 = require("../util/command-util");
50
- const git_util_1 = require("../util/git-util");
51
- const logger_1 = require("../util/logger");
52
- const validation_util_1 = require("../util/validation-util");
53
- const path = require("path");
17
+ import { Option } from 'commander';
18
+ import * as fs from 'fs';
19
+ import { glob } from 'glob';
20
+ import * as minimatch from 'minimatch';
21
+ import * as readline from 'readline-sync';
22
+ import sh from 'shelljs';
23
+ import { baseCommand, configureShell, getShellConfig } from '../util/command-util.js';
24
+ import { getChangesOfLastCommit, getLastModificationDate, getUncommittedChanges } from '../util/git-util.js';
25
+ import * as path from 'path';
26
+ import { LOGGER } from '../util/logger.js';
27
+ import { validateGitDirectory } from '../util/validation-util.js';
54
28
  const checkTypes = ['full', 'changes', 'lastCommit'];
55
- const severityTypes = ['error', 'warn', 'ok'];
56
29
  const DEFAULT_EXCLUDES = ['**/@(node_modules|lib|dist|bundle)/**'];
57
- const YEAR_RANGE_REGEX = /\d{4}(?:-d{4})?/g;
58
- const HEADER_PATTERN = 'Copyright \\([cC]\\) \\d{4}(-d{4})?';
30
+ const YEAR_RANGE_REGEX = /\d{4}/g;
31
+ const HEADER_PATTERN = 'Copyright \\([cC]\\) \\d{4}';
59
32
  const AUTO_FIX_MESSAGE = 'Fix copyright header violations';
60
- exports.CheckHeaderCommand = (0, command_util_1.baseCommand)() //
33
+ export const CheckHeaderCommand = baseCommand() //
61
34
  .name('checkHeaders')
62
- .description('Validates the copyright year range of license header files')
63
- .argument('<rootDir>', 'The starting directory for the check', validation_util_1.validateGitDirectory)
64
- .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' +
35
+ .description('Validates the copyright year range (end year) of license header files')
36
+ .argument('<rootDir>', 'The starting directory for the check', validateGitDirectory)
37
+ .addOption(new Option('-t, --type <type>', 'The scope of the check. In addition to a full recursive check, is also possible to only' +
65
38
  ' consider pending changes or the last commit')
66
39
  .choices(checkTypes)
67
40
  .default('full'))
68
41
  .option('-f, --fileExtensions <extensions...>', 'File extensions that should be checked', ['ts', 'tsx'])
69
- .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}]`))
42
+ .addOption(new 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
43
  .option('--no-exclude-defaults', 'Disables the default excludes patterns. Only explicitly passed exclude patterns (-e, --exclude) are considered')
71
44
  .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
45
  .option('-a, --autoFix', 'Auto apply & commit fixes without prompting the user', false)
76
46
  .action(checkHeaders);
77
- function checkHeaders(rootDir, options) {
78
- (0, command_util_1.configureShell)({ silent: true, fatal: true });
47
+ export function checkHeaders(rootDir, options) {
48
+ configureShell({ silent: true, fatal: true });
79
49
  if (options.excludeDefaults) {
80
50
  options.exclude.push(...DEFAULT_EXCLUDES);
81
51
  }
82
52
  sh.cd(rootDir);
83
53
  const files = getFiles(rootDir, options);
84
- logger_1.LOGGER.info(`Check copy right headers of ${files.length} files`);
54
+ LOGGER.info(`Check copy right headers of ${files.length} files`);
85
55
  if (files.length === 0) {
86
- logger_1.LOGGER.info('Check completed');
56
+ LOGGER.info('Check completed');
87
57
  return;
88
58
  }
89
59
  const results = validate(rootDir, files, options);
90
60
  handleValidationResults(rootDir, results, options);
91
61
  }
92
- exports.checkHeaders = checkHeaders;
93
62
  function getFiles(rootDir, options) {
94
63
  const includePattern = `**/*.@(${options.fileExtensions.join('|')})`;
95
64
  const excludePattern = options.exclude;
96
65
  if (options.type === 'full') {
97
- return glob_1.glob.sync(includePattern, {
66
+ return glob.sync(includePattern, {
98
67
  cwd: rootDir,
99
68
  ignore: excludePattern
100
69
  });
101
70
  }
102
- let changedFiles = options.type === 'changes' ? (0, git_util_1.getUncommittedChanges)(rootDir) : (0, git_util_1.getChangesOfLastCommit)(rootDir);
71
+ let changedFiles = options.type === 'changes' ? getUncommittedChanges(rootDir) : getChangesOfLastCommit(rootDir);
103
72
  changedFiles = changedFiles.filter(minimatch.filter(includePattern));
104
73
  excludePattern.forEach(pattern => {
105
74
  changedFiles = changedFiles.filter(minimatch.filter(`!${pattern}`));
@@ -108,24 +77,19 @@ function getFiles(rootDir, options) {
108
77
  }
109
78
  function validate(rootDir, files, options) {
110
79
  var _a;
111
- // Derives all files with valid headers, their copyright years and all files with no or invalid headers
80
+ // Derives all files with valid headers and all files with no or invalid headers
112
81
  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
82
  const noHeaders = files.filter(file => !filesWithHeader.includes(file));
119
83
  const results = [];
120
84
  const allFilesLength = files.length;
121
85
  // Create validation results for all files with no or invalid headers
122
86
  const noHeadersLength = noHeaders.length;
123
87
  if (noHeadersLength > 0) {
124
- logger_1.LOGGER.info(`Found ${noHeadersLength} files with no (or an invalid) copyright header`);
88
+ LOGGER.info(`Found ${noHeadersLength} files with no (or an invalid) copyright header`);
125
89
  }
126
90
  noHeaders.forEach((file, i) => {
127
91
  printFileProgress(i + 1, allFilesLength, `Validating ${file}`);
128
- results.push({ file: path.resolve(rootDir, file), violation: 'noOrMissingHeader', severity: 'error' });
92
+ results.push({ file: path.resolve(rootDir, file), violation: 'noOrMissingHeader' });
129
93
  });
130
94
  // Performance optimization: avoid retrieving the dates for each individual file by precalculating the endYear if possible.
131
95
  let defaultEndYear;
@@ -133,79 +97,43 @@ function validate(rootDir, files, options) {
133
97
  defaultEndYear = new Date().getFullYear();
134
98
  }
135
99
  else if (options.type === 'lastCommit') {
136
- defaultEndYear = (_a = (0, git_util_1.getLastModificationDate)(undefined, rootDir)) === null || _a === void 0 ? void 0 : _a.getFullYear();
100
+ defaultEndYear = (_a = getLastModificationDate(undefined, rootDir)) === null || _a === void 0 ? void 0 : _a.getFullYear();
137
101
  }
138
102
  // Create validation results for all files with valid headers
139
103
  filesWithHeader.forEach((file, i) => {
140
104
  printFileProgress(i + 1 + noHeadersLength, allFilesLength, `Validating ${file}`);
141
- const result = {
142
- currentStartYear: copyrightYears[i].shift(),
143
- expectedStartYear: (0, git_util_1.getFirstModificationDate)(file, rootDir, AUTO_FIX_MESSAGE).getFullYear(),
144
- currentEndYear: copyrightYears[i].shift(),
145
- expectedEndYear: defaultEndYear !== null && defaultEndYear !== void 0 ? defaultEndYear : (0, git_util_1.getLastModificationDate)(file, rootDir, AUTO_FIX_MESSAGE).getFullYear(),
146
- file,
147
- severity: 'ok',
148
- violation: 'none'
149
- };
150
- if (result.expectedStartYear === result.expectedEndYear) {
151
- validateSingleYear(result);
105
+ const copyrightLine = sh.head({ '-n': 2 }, file).stdout.trim().split('\n')[1];
106
+ const copyRightYears = copyrightLine.match(YEAR_RANGE_REGEX);
107
+ if (!copyRightYears) {
108
+ const result = { file, violation: 'noYear', line: copyrightLine };
109
+ results.push(result);
152
110
  }
153
111
  else {
154
- validateTimePeriod(result);
112
+ const currentStartYear = Number.parseInt(copyRightYears[0], 10);
113
+ const currentEndYear = copyRightYears[1] ? Number.parseInt(copyRightYears[1], 10) : undefined;
114
+ const result = {
115
+ currentStartYear,
116
+ currentEndYear,
117
+ expectedEndYear: defaultEndYear !== null && defaultEndYear !== void 0 ? defaultEndYear : getLastModificationDate(file, rootDir, AUTO_FIX_MESSAGE).getFullYear(),
118
+ file,
119
+ violation: 'none'
120
+ };
121
+ validateEndYear(result);
122
+ results.push(result);
155
123
  }
156
- results.push(result);
157
124
  });
158
125
  results.sort((a, b) => a.file.localeCompare(b.file));
159
126
  process.stdout.clearLine(0);
160
127
  return results;
161
128
  }
162
- function validateSingleYear(result) {
163
- const { currentStartYear, expectedStartYear, currentEndYear } = result;
164
- result.violation = 'invalidCopyrightYear';
165
- result.severity = 'error';
166
- if (!currentEndYear) {
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) {
129
+ function validateEndYear(result) {
130
+ const { currentStartYear, expectedEndYear, currentEndYear } = result;
131
+ result.violation = 'invalidEndYear';
132
+ const valid = currentEndYear ? currentEndYear === expectedEndYear : currentStartYear === expectedEndYear;
133
+ if (valid) {
194
134
  result.violation = 'none';
195
- result.severity = 'ok';
196
135
  return;
197
136
  }
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
137
  }
210
138
  function printFileProgress(currentFileCount, maxFileCount, message, clear = true) {
211
139
  if (clear) {
@@ -217,74 +145,65 @@ function printFileProgress(currentFileCount, maxFileCount, message, clear = true
217
145
  process.stdout.write('\n');
218
146
  }
219
147
  }
220
- function handleValidationResults(rootDir, results, options) {
221
- logger_1.LOGGER.newLine();
222
- logger_1.LOGGER.info(`Header validation for ${results.length} files completed`);
223
- const violations = results.filter(result => result.severity === 'error');
148
+ export function handleValidationResults(rootDir, results, options) {
149
+ LOGGER.newLine();
150
+ LOGGER.info(`Header validation for ${results.length} files completed`);
151
+ const violations = results.filter(result => result.violation !== 'none');
224
152
  // Adjust results to print based on configured severity level
225
- let toPrint = results;
226
- if (options.severity === 'error') {
227
- toPrint = violations;
228
- }
229
- else if (options.severity === 'warn') {
230
- toPrint = results.filter(result => result.severity !== 'ok');
231
- }
232
- logger_1.LOGGER.info(`Found ${toPrint.length} copyright header violations:`);
233
- logger_1.LOGGER.newLine();
234
- toPrint.forEach((result, i) => logger_1.LOGGER.info(`${i + 1}. `, result.file, ':', toPrintMessage(result)));
235
- logger_1.LOGGER.newLine();
153
+ const toPrint = violations;
154
+ LOGGER.info(`Found ${toPrint.length} copyright header violations:`);
155
+ LOGGER.newLine();
156
+ toPrint.forEach((result, i) => LOGGER.info(`${i + 1}. `, result.file, ':', toPrintMessage(result)));
157
+ LOGGER.newLine();
236
158
  if (options.json) {
237
159
  fs.writeFileSync(path.join(rootDir, 'headerCheck.json'), JSON.stringify(results, undefined, 2));
238
160
  }
239
- if (violations.length > 0 && (options.autoFix || readline.keyInYN('Do you want automatically fix copyright year range violations?'))) {
240
- const toFix = violations.filter(violation => violation.severity === 'error' && isDateValidationResult(violation));
161
+ if (violations.length > 0 &&
162
+ (options.autoFix || readline.keyInYN('Do you want to automatically fix copyright year range violations?'))) {
163
+ const toFix = violations.filter(violation => isDateValidationResult(violation));
241
164
  fixViolations(rootDir, toFix, options);
242
165
  }
243
- logger_1.LOGGER.info('Check completed');
166
+ LOGGER.info('Check completed');
244
167
  }
245
- exports.handleValidationResults = handleValidationResults;
246
168
  function toPrintMessage(result) {
247
- const colors = {
248
- error: '\x1b[31m',
249
- warn: '\x1b[33m',
250
- ok: '\x1b[32m'
251
- };
252
- if (isDateValidationResult(result) &&
253
- (result.violation === 'incorrectCopyrightPeriod' || result.violation === 'invalidCopyrightYear')) {
254
- const expected = result.expectedStartYear !== result.expectedEndYear
255
- ? `${result.expectedStartYear}-${result.expectedEndYear}`
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}'`;
169
+ const error = '\x1b[31m';
170
+ const info = '\x1b[32m';
171
+ if (isDateValidationResult(result) && result.violation === 'invalidEndYear') {
172
+ const expected = result.expectedEndYear.toString();
173
+ const actual = result.currentEndYear
174
+ ? `${result.currentEndYear} (${result.currentStartYear}-${result.currentEndYear})`
175
+ : result.currentStartYear.toString();
176
+ const message = 'Invalid copyright end year';
177
+ return `${error} ${message}! Expected end year '${expected}' but is '${actual}'`;
260
178
  }
261
179
  else if (result.violation === 'noOrMissingHeader') {
262
- return `${colors[result.severity]} No or invalid copyright header!`;
180
+ return `${error} No or invalid copyright header!`;
263
181
  }
264
- return `${colors[result.severity]} OK`;
182
+ else if (result.violation === 'noYear') {
183
+ return `${error} No year found!${result.line ? ' (line: ' + result.line + ')' : ''}`;
184
+ }
185
+ return `${info} OK`;
265
186
  }
266
187
  function fixViolations(rootDir, violations, options) {
267
- logger_1.LOGGER.newLine();
188
+ LOGGER.newLine();
268
189
  violations.forEach((violation, i) => {
269
190
  printFileProgress(i + 1, violations.length, `Fix ${violation.file}`, false);
270
- const fixedStartYear = violation.currentStartYear < violation.expectedStartYear ? violation.currentStartYear : violation.expectedStartYear;
271
191
  const currentRange = `${violation.currentStartYear}${violation.currentEndYear ? '-' + violation.currentEndYear : ''}`;
272
- let fixedRange = `${fixedStartYear}`;
273
- if (violation.expectedEndYear !== violation.expectedStartYear || fixedStartYear !== violation.expectedStartYear) {
274
- fixedRange = `${fixedStartYear}-${violation.expectedEndYear}`;
275
- }
192
+ const fixedRange = violation.currentEndYear || violation.currentStartYear < violation.expectedEndYear
193
+ ? `${violation.currentStartYear}-${violation.expectedEndYear}`
194
+ : `${violation.expectedEndYear}`;
276
195
  sh.sed('-i', RegExp('Copyright \\([cC]\\) ' + currentRange), `Copyright (c) ${fixedRange}`, violation.file);
277
196
  });
278
- logger_1.LOGGER.newLine();
197
+ LOGGER.newLine();
279
198
  if (options.autoFix || readline.keyInYN('Do you want to create a commit for the fixed files?')) {
280
- logger_1.LOGGER.newLine();
199
+ LOGGER.newLine();
281
200
  const files = violations.map(violation => violation.file).join(' ');
282
- sh.exec(`git add ${files}`, (0, command_util_1.getShellConfig)());
201
+ sh.exec(`git add ${files}`, getShellConfig());
283
202
  sh.exec(`git commit -m "${AUTO_FIX_MESSAGE}"`);
284
- logger_1.LOGGER.newLine();
203
+ LOGGER.newLine();
285
204
  }
286
205
  }
287
206
  function isDateValidationResult(object) {
288
- return 'currentStartYear' in object && 'expectedStartYear' in object && 'expectedEndYear' in object;
207
+ return 'currentStartYear' in object && 'expectedEndYear' in object;
289
208
  }
290
209
  //# 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,yCAAmC;AACnC,uCAAyB;AACzB,+BAA4B;AAC5B,qDAAuC;AACvC,wDAA0C;AAC1C,4CAA8B;AAC9B,uDAAmF;AACnF,+CAO0B;AAE1B,2CAAwC;AACxC,6DAA+D;AAC/D,6BAA8B;AAW9B,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,YA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