From bba427b89e22495ab49ed672c4eea67015932031 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Mon, 25 Sep 2023 11:59:22 -0400 Subject: [PATCH 01/15] copy expectDiagnostics from brighterscript for tests (#95) * copy expectDiagnostics from brighterscript for tests * Don't run double builds for PR pushes --- .github/workflows/build.yml | 8 +- package-lock.json | 13 +++ package.json | 1 + src/plugins/checkUsage/index.spec.ts | 30 ++--- src/plugins/codeStyle/index.spec.ts | 14 +-- src/plugins/trackCodeFlow/index.spec.ts | 25 ++--- src/testHelpers.spec.ts | 140 ++++++++++++++++++++++++ 7 files changed, 179 insertions(+), 52 deletions(-) create mode 100644 src/testHelpers.spec.ts diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 97e8329..e6a7ef3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,11 @@ name: build -on: [push, pull_request] +on: + push: + branches: + - master + tags: + - v* + pull_request: jobs: ci: diff --git a/package-lock.json b/package-lock.json index 7bc9b7b..15fc1d7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ "mocha": "^9.2.2", "nyc": "^15.1.0", "source-map-support": "^0.5.21", + "thenby": "^1.3.4", "ts-node": "^10.7.0", "typescript": "^4.9.4" }, @@ -4491,6 +4492,12 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, + "node_modules/thenby": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/thenby/-/thenby-1.3.4.tgz", + "integrity": "sha512-89Gi5raiWA3QZ4b2ePcEwswC3me9JIg+ToSgtE0JWeCynLnLxNr/f9G+xfo9K+Oj4AFdom8YNJjibIARTJmapQ==", + "dev": true + }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -8452,6 +8459,12 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, + "thenby": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/thenby/-/thenby-1.3.4.tgz", + "integrity": "sha512-89Gi5raiWA3QZ4b2ePcEwswC3me9JIg+ToSgtE0JWeCynLnLxNr/f9G+xfo9K+Oj4AFdom8YNJjibIARTJmapQ==", + "dev": true + }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", diff --git a/package.json b/package.json index 80ddae3..1331443 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "mocha": "^9.2.2", "nyc": "^15.1.0", "source-map-support": "^0.5.21", + "thenby": "^1.3.4", "ts-node": "^10.7.0", "typescript": "^4.9.4" }, diff --git a/src/plugins/checkUsage/index.spec.ts b/src/plugins/checkUsage/index.spec.ts index 5f0ad95..a988d71 100644 --- a/src/plugins/checkUsage/index.spec.ts +++ b/src/plugins/checkUsage/index.spec.ts @@ -1,19 +1,9 @@ -import { expect } from 'chai'; -import { BsDiagnostic, Program } from 'brighterscript'; +import { Program } from 'brighterscript'; +import * as path from 'path'; import Linter from '../../Linter'; import { createContext, PluginWrapperContext } from '../../util'; import CheckUsage from './index'; - -function pad(n: number) { - return n > 9 ? `${n}` : `0${n}`; -} - -function fmtDiagnostics(diagnostics: BsDiagnostic[]) { - return diagnostics - .filter((d) => d.severity && d.severity < 4) - .sort((a, b) => a.range.start.line - b.range.start.line) - .map((d) => `${pad(d.range.start.line + 1)}:${d.code}:${d.message}`.replace('\\', '/')); // Win to nix path -} +import { expectDiagnosticsFmt } from '../../testHelpers.spec'; describe('checkUsage', () => { let linter: Linter; @@ -44,9 +34,7 @@ describe('checkUsage', () => { rules: { } }); - const actual = fmtDiagnostics(diagnostics); - const expected = []; - expect(actual).deep.equal(expected); + expectDiagnosticsFmt(diagnostics, []); }); it('detects component refered as child', async () => { @@ -61,11 +49,9 @@ describe('checkUsage', () => { rules: { } }); - const actual = fmtDiagnostics(diagnostics); - const expected = [ - `01:LINT4002:Script 'components/child2.brs' does not seem to be used`, - `02:LINT4001:Component 'components/child2.xml' does not seem to be used` - ]; - expect(actual).deep.equal(expected); + expectDiagnosticsFmt(diagnostics, [ + `01:LINT4002:Script 'components${path.sep}child2.brs' does not seem to be used`, + `02:LINT4001:Component 'components${path.sep}child2.xml' does not seem to be used` + ]); }); }); diff --git a/src/plugins/codeStyle/index.spec.ts b/src/plugins/codeStyle/index.spec.ts index 57864c4..3136b3f 100644 --- a/src/plugins/codeStyle/index.spec.ts +++ b/src/plugins/codeStyle/index.spec.ts @@ -1,20 +1,10 @@ import * as fs from 'fs'; import { expect } from 'chai'; -import { AALiteralExpression, AssignmentStatement, BsDiagnostic, ParseMode, Parser, Program, util } from 'brighterscript'; +import { AALiteralExpression, AssignmentStatement, ParseMode, Parser, Program, util } from 'brighterscript'; import Linter from '../../Linter'; import CodeStyle, { collectWrappingAAMembersIndexes } from './index'; import { createContext, PluginWrapperContext } from '../../util'; - -function pad(n: number) { - return n > 9 ? `${n}` : `0${n}`; -} - -function fmtDiagnostics(diagnostics: BsDiagnostic[]) { - return diagnostics - .filter((d) => d.severity && d.severity < 4) - .sort((a, b) => a.range.start.line - b.range.start.line) - .map((d) => `${pad(d.range.start.line + 1)}:${d.code}:${d.message}`); -} +import { fmtDiagnostics } from '../../testHelpers.spec'; describe('codeStyle', () => { let linter: Linter; diff --git a/src/plugins/trackCodeFlow/index.spec.ts b/src/plugins/trackCodeFlow/index.spec.ts index b4460be..464fe5a 100644 --- a/src/plugins/trackCodeFlow/index.spec.ts +++ b/src/plugins/trackCodeFlow/index.spec.ts @@ -1,21 +1,12 @@ import * as fs from 'fs'; import { expect } from 'chai'; -import { BsDiagnostic, Program } from 'brighterscript'; +import { Program, util } from 'brighterscript'; import Linter from '../../Linter'; import TrackCodeFlow from './index'; import bslintFactory from '../../index'; import { createContext, PluginWrapperContext } from '../../util'; - -function pad(n: number) { - return n > 9 ? `${n}` : `0${n}`; -} - -function fmtDiagnostics(diagnostics: BsDiagnostic[]) { - return diagnostics - .filter((d) => d.severity && d.severity < 4) - .sort((a, b) => a.range.start.line - b.range.start.line) - .map((d) => `${pad(d.range.start.line + 1)}:${d.code}:${d.message}`); -} +import { expectDiagnostics, fmtDiagnostics } from '../../testHelpers.spec'; +import { VarLintError } from './varTracking'; describe('trackCodeFlow', () => { let linter: Linter; @@ -56,11 +47,11 @@ describe('trackCodeFlow', () => { `); program.validate(); - expect( - fmtDiagnostics(program.getDiagnostics()) - ).to.eql([ - `10:LINT1003:Not all the code paths assign 'text2'` - ]); + expectDiagnostics(program, [{ + code: VarLintError.UnsafeInitialization, + message: `Not all the code paths assign 'text2'`, + range: util.createRange(9, 22, 9, 27) + }]); }); it('detects use of uninitialized vars', async () => { diff --git a/src/testHelpers.spec.ts b/src/testHelpers.spec.ts new file mode 100644 index 0000000..563e441 --- /dev/null +++ b/src/testHelpers.spec.ts @@ -0,0 +1,140 @@ +import { BsDiagnostic, BscFile, DiagnosticSeverity, DiagnosticTag, Range } from 'brighterscript'; +import { CodeDescription, DiagnosticRelatedInformation, Diagnostic } from 'vscode-languageserver-types'; +import { expect } from 'chai'; +import { firstBy } from 'thenby'; + +type DiagnosticCollection = { getDiagnostics: () => Array } | { diagnostics: Diagnostic[] } | Diagnostic[]; +function getDiagnostics(arg: DiagnosticCollection): BsDiagnostic[] { + if (Array.isArray(arg)) { + return arg as BsDiagnostic[]; + } else if ((arg as any).getDiagnostics) { + return (arg as any).getDiagnostics(); + } else if ((arg as any).diagnostics) { + return (arg as any).diagnostics; + } else { + throw new Error('Cannot derive a list of diagnostics from ' + JSON.stringify(arg)); + } +} + +function sortDiagnostics(diagnostics: BsDiagnostic[]) { + return diagnostics.sort( + firstBy('code') + .thenBy('message') + .thenBy((a, b) => (a.range?.start?.line ?? 0) - (b.range?.start?.line ?? 0)) + .thenBy((a, b) => (a.range?.start?.character ?? 0) - (b.range?.start?.character ?? 0)) + .thenBy((a, b) => (a.range?.end?.line ?? 0) - (b.range?.end?.line ?? 0)) + .thenBy((a, b) => (a.range?.end?.character ?? 0) - (b.range?.end?.character ?? 0)) + ); +} + +function cloneObject(original: TOriginal, template: TTemplate, defaultKeys: Array) { + const clone = {} as Partial; + let keys = Object.keys(template ?? {}) as Array; + // if there were no keys provided, use some sane defaults + keys = keys.length > 0 ? keys : defaultKeys; + + // copy only compare the specified keys from actualDiagnostic + for (const key of keys) { + clone[key] = original[key]; + } + return clone; +} + +interface PartialDiagnostic { + range?: Range; + severity?: DiagnosticSeverity; + code?: number | string; + codeDescription?: Partial; + source?: string; + message?: string; + tags?: Partial[]; + relatedInformation?: Partial[]; + data?: unknown; + file?: Partial; +} + +/** + * Helper function to clone a Diagnostic so it will give partial data that has the same properties as the expected + */ +function cloneDiagnostic(actualDiagnosticInput: BsDiagnostic, expectedDiagnostic: BsDiagnostic) { + const actualDiagnostic = cloneObject( + actualDiagnosticInput, + expectedDiagnostic, + ['message', 'code', 'range', 'severity', 'relatedInformation'] + ); + // deep clone relatedInformation if available + if (actualDiagnostic.relatedInformation) { + for (let j = 0; j < actualDiagnostic.relatedInformation.length; j++) { + actualDiagnostic.relatedInformation[j] = cloneObject( + actualDiagnostic.relatedInformation[j], + expectedDiagnostic?.relatedInformation[j], + ['location', 'message'] + ) as any; + } + } + // deep clone file info if available + if (actualDiagnostic.file) { + actualDiagnostic.file = cloneObject( + actualDiagnostic.file, + expectedDiagnostic?.file, + ['srcPath', 'pkgPath'] + ) as any; + } + return actualDiagnostic; +} + + +/** + * Ensure the DiagnosticCollection exactly contains the data from expected list. + * @param arg - any object that contains diagnostics (such as `Program`, `Scope`, or even an array of diagnostics) + * @param expected an array of expected diagnostics. if it's a string, assume that's a diagnostic error message + */ +export function expectDiagnostics(arg: DiagnosticCollection, expected: Array) { + const actualDiagnostics = sortDiagnostics( + getDiagnostics(arg) + ); + const expectedDiagnostics = sortDiagnostics( + expected.map(x => { + let result = x; + if (typeof x === 'string') { + result = { message: x }; + } else if (typeof x === 'number') { + result = { code: x }; + } + return result as unknown as BsDiagnostic; + }) + ); + + const actual = [] as BsDiagnostic[]; + for (let i = 0; i < actualDiagnostics.length; i++) { + const expectedDiagnostic = expectedDiagnostics[i]; + const actualDiagnostic = cloneDiagnostic(actualDiagnostics[i], expectedDiagnostic); + actual.push(actualDiagnostic as any); + } + expect(actual).to.eql(expectedDiagnostics); +} + + +function pad(n: number) { + return n > 9 ? `${n}` : `0${n}`; +} + +export function fmtDiagnostics(diagnostics: BsDiagnostic[]) { + return diagnostics + .filter((d) => d.severity && d.severity < 4) + .sort((a, b) => a.range.start.line - b.range.start.line) + .map((d) => `${pad(d.range.start.line + 1)}:${d.code}:${d.message}`); +} + +/** + * Format a list of diagnostics and ensure they match the expectedDiagnostics string list + */ +export function expectDiagnosticsFmt(diagnosticCollection: DiagnosticCollection, expectedDiagnostics: string[]) { + const diagnostics = getDiagnostics(diagnosticCollection); + const formatted = fmtDiagnostics(diagnostics); + expect( + formatted + ).eql( + expectedDiagnostics + ); +} From 3995e5fa379fc780fba493108d94ead2dfeb4996 Mon Sep 17 00:00:00 2001 From: Charlie Abbott Date: Thu, 28 Sep 2023 15:20:10 +0100 Subject: [PATCH 02/15] [WIP] Color format checking for bslint (#94) * Color format checking - first step/ example * Color format checking * Color format checking * Color format, alpha, default alpha, case and color cert requirement checking * Adding alpha to luma check and removing todo * Updating readme * Moving color validate functions to util for use in multiple files * Updating readme * Removing isXMLFile checking * Temp example for traversing to XML node arrtibute values * Moving XML color validation to codeStyle * Moving XML color validation to codeStyle * Moving XML color validation to codeStyle * Starting refactor * Continuing refactor * Continuing refactor * Continuing refactor * Removing XML file checks - will add these in a seperate PR * Continuing refactor * PR comment fixes * Continuing refactor * Continuing refactor * Continuing refactor * Fixing build errors * Including non color string checks * Removing initial code for fixes. Due to add in a future PR * Including non color string checks * Continuing refactor * Move all test brs/bs code inline * Continuing refactor * Fix templatestring quasi handling * Remove unused color test files * Removing breakpoint * only validate string-like template strings --------- Co-authored-by: Charlie Abbott <106152156+charlie-abbott-deltatre@users.noreply.github.com> Co-authored-by: Bronley Plumb --- README.md | 38 +++ src/createColorValidator.ts | 105 +++++++ src/index.ts | 15 + src/plugins/codeStyle/diagnosticMessages.ts | 42 ++- src/plugins/codeStyle/index.spec.ts | 321 +++++++++++++++++++- src/plugins/codeStyle/index.ts | 18 +- src/plugins/codeStyle/styleFixes.ts | 2 +- src/util.ts | 7 +- 8 files changed, 542 insertions(+), 6 deletions(-) create mode 100644 src/createColorValidator.ts diff --git a/README.md b/README.md index e338100..f47e760 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,12 @@ Default rules: "type-annotations": "off", + "color-format": "off", + "color-case": "off", + "color-alpha": "off", + "color-alpha-defaults": "off", + "color-cert": "off", + "assign-all-paths": "error", "unsafe-path-loop": "error", "unsafe-iterators": "error", @@ -210,6 +216,38 @@ Default rules: - `never` enforces that files do not end with a newline - `off`: do not validate +- `color-format`: ensures that all the color values follow the same prefix formatting. Can also use to prevent any colors values from being defined in the code-base (brs or bs files), except for values in a stand-alone file (ie. theme file). + + - `hash-hex`: enforces all color values are type string or template string and use a `#` prefix + - `quoted-numeric-hex`: enforces all color values are type string or template string and use a `0x` prefix + - `never`: enforces that no color values can be defined in the code-base (brs or bs files). Useful if you define colors in a separate stand-alone file. To use this option you would list your stand-alone file in the `ignore` list or `diagnosticFilters`. + - `off`: do not validate (**default**) + +- `color-case`: ensures that all color values follow the same case. Requires that `color-format` is set to `hash-hex` or `quoted-numeric-hex`. + + - `lower`: enforces all color values that are type string or template string and all lowercase. ie. `#11bbdd` + - `upper`: enforces all color values that are type string or template string and all uppercase. ie. `#EEAA44` + - `off`: do not validate (**default**) + +- `color-alpha`: defines the usage of the color alpha value. ie. `#xxxxxxFF`. Requires that `color-format` is set to `hash-hex` or `quoted-numeric-hex`. + + - `always`: enforces all color values that are type string or template string define an alpha value + - `allowed`: allows color values that are type string or template string to define an alpha value + - `never`: enforces that none of the color values that are type string or template string define an alpha value + - `off`: do not validate (**default**) + +- `color-alpha-defaults`: enforces default color-alpha values. ie. `#xxxxxxFF` or `#xxxxxx00`. Requires that `color-alpha` is not set to `off` and `color-format` is set to `hash-hex` or `quoted-numeric-hex`. + + - `allowed`: allows both types of defaults to be used + - `only-hidden`: only allows opacity 0% (hidden) from being used + - `never`: enforces that no defaults can be used + - `off`: do not validate (**default**) + +- `color-cert`: enforces Roku's [broadcast safe color 6.4 certification requirement](https://developer.roku.com/en-gb/docs/developer-program/certification/certification.md). Requires that `color-format` is set to `hash-hex` or `quoted-numeric-hex`. + + - `always`: ensures all white and black color-format values either match or are darker/ lighter than the minimum recommended values. For white the minimum value is `#DBDBDB` and for black the minimum value is `#161616` + - `off`: do not validate (**default**) + ### Strictness rules - `type-annotations`: validation of presence of `as` type annotations, for function diff --git a/src/createColorValidator.ts b/src/createColorValidator.ts new file mode 100644 index 0000000..dade4dd --- /dev/null +++ b/src/createColorValidator.ts @@ -0,0 +1,105 @@ +import { BsDiagnostic, Range } from 'brighterscript'; +import { messages } from './plugins/codeStyle/diagnosticMessages'; +import { BsLintRules, RuleColorFormat, RuleColorCase, RuleColorAlpha, RuleColorAlphaDefaults, RuleColorCertCompliant } from './index'; + +export function createColorValidator(severity: Readonly) { + const { colorFormat, colorCase, colorAlpha, colorAlphaDefaults, colorCertCompliant } = severity; + return (text, range, diagnostics) => { + const len = text.length; + if (len < 7 || len > 12) { + // we're only interested in string length is between 7 (#DBDBDB) to 12 ("0xDBDBDBff") chars long + return; + } + + const hashHexRegex = /#[0-9A-Fa-f]{6}/g; + const quotedNumericHexRegex = /0x[0-9A-Fa-f]{6}/g; + const hashHexMatches = (text.startsWith('#') || text.startsWith('"#')) ? text.match(hashHexRegex) : undefined; + const quotedNumericHexMatches = (text.startsWith('0x') || text.startsWith('"0x')) ? text.match(quotedNumericHexRegex) : undefined; + + if ((colorFormat === 'never') && (quotedNumericHexMatches || hashHexMatches)) { + diagnostics.push(messages.expectedColorFormat(range)); + return; + } + const hashHexAlphaRegex = /#[0-9A-Fa-f]{8}/g; + const quotedNumericHexAlphaRegex = /0x[0-9A-Fa-f]{8}/g; + + if (colorFormat === 'hash-hex') { + if (quotedNumericHexMatches) { + diagnostics.push(messages.expectedColorFormat(range)); + } + validateColorCase(hashHexMatches, range, diagnostics, colorCase, colorFormat); + validateColorAlpha(text.match(hashHexAlphaRegex), hashHexMatches, quotedNumericHexMatches, range, diagnostics, colorAlpha, colorAlphaDefaults); + validateColorCertCompliance(hashHexMatches, range, diagnostics, colorFormat, colorCertCompliant); + + } else if (colorFormat === 'quoted-numeric-hex') { + if (hashHexMatches) { + diagnostics.push(messages.expectedColorFormat(range)); + } + validateColorCase(quotedNumericHexMatches, range, diagnostics, colorCase, colorFormat); + validateColorAlpha(text.match(quotedNumericHexAlphaRegex), hashHexMatches, quotedNumericHexMatches, range, diagnostics, colorAlpha, colorAlphaDefaults); + validateColorCertCompliance(quotedNumericHexMatches, range, diagnostics, colorFormat, colorCertCompliant); + } + }; +} + +function validateColorAlpha(alphaMatches: RegExpMatchArray, hashMatches: RegExpMatchArray, quotedNumericHexMatches: RegExpMatchArray, range: Range, diagnostics: (Omit)[], alpha: RuleColorAlpha, alphaDefaults: RuleColorAlphaDefaults) { + const validateColorAlpha = (alpha === 'never' || alpha === 'always' || alpha === 'allowed'); + if (validateColorAlpha) { + if (alpha === 'never' && alphaMatches) { + diagnostics.push(messages.expectedColorAlpha(range)); + } + if ((alpha === 'always' && alphaMatches === null) && (hashMatches || quotedNumericHexMatches)) { + diagnostics.push(messages.expectedColorAlpha(range)); + } + if ((alphaDefaults === 'never' || alphaDefaults === 'only-hidden') && alphaMatches) { + for (let i = 0; i < alphaMatches.length; i++) { + const colorHashAlpha = alphaMatches[i]; + const alphaValue = colorHashAlpha.slice(-2).toLowerCase(); + if (alphaValue === 'ff' || (alphaDefaults === 'never' && alphaValue === '00')) { + diagnostics.push(messages.expectedColorAlphaDefaults(range)); + } + } + } + } +} + +function validateColorCase(matches: RegExpMatchArray, range: Range, diagnostics: (Omit)[], colorCase: RuleColorCase, colorFormat: RuleColorFormat) { + const validateColorCase = colorCase === 'upper' || colorCase === 'lower'; + if (validateColorCase && matches) { + let colorValue = matches[0]; + const charsToStrip = (colorFormat === 'hash-hex') ? 1 : 2; + colorValue = colorValue.substring(charsToStrip); + if (colorCase === 'lower' && colorValue !== colorValue.toLowerCase()) { + diagnostics.push(messages.expectedColorCase(range)); + } + if (colorCase === 'upper' && colorValue !== colorValue.toUpperCase()) { + diagnostics.push(messages.expectedColorCase(range)); + } + } +} + +function validateColorCertCompliance(matches: RegExpMatchArray, range: Range, diagnostics: (Omit)[], colorFormat: RuleColorFormat, certCompliant: RuleColorCertCompliant) { + const validateCertCompliant = certCompliant === 'always'; + if (validateCertCompliant && matches) { + const BROADCAST_SAFE_BLACK = '161616'; + const BROADCAST_SAFE_WHITE = 'DBDBDB'; + const MAX_BLACK_LUMA = getColorLuma(BROADCAST_SAFE_BLACK); + const MAX_WHITE_LUMA = getColorLuma(BROADCAST_SAFE_WHITE); + let colorValue = matches[0]; + const charsToStrip = (colorFormat === 'hash-hex') ? 1 : 2; + colorValue = colorValue.substring(charsToStrip); + const colorLuma = getColorLuma(colorValue); + if (colorLuma > MAX_WHITE_LUMA || colorLuma < MAX_BLACK_LUMA) { + diagnostics.push(messages.colorCertCompliance(range)); + } + } +} + +function getColorLuma(value: string) { + const rgb = parseInt(value, 16); // Convert rrggbb to decimal + const red = (rgb >> 16) & 0xff; // eslint-disable-line no-bitwise + const green = (rgb >> 8) & 0xff; // eslint-disable-line no-bitwise + const blue = (rgb >> 0) & 0xff; // eslint-disable-line no-bitwise + // Per ITU-R BT.709 + return 0.2126 * red + 0.7152 * green + 0.0722 * blue; // eslint-disable-line +} diff --git a/src/index.ts b/src/index.ts index 7d3b981..a6a56c3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,6 +13,11 @@ export type RuleFunction = 'no-function' | 'no-sub' | 'auto' | 'off'; export type RuleAAComma = 'always' | 'no-dangling' | 'never' | 'off'; export type RuleTypeAnnotations = 'all' | 'return' | 'args' | 'off'; export type RuleEolLast = 'always' | 'never' | 'off'; +export type RuleColorFormat = 'hash-hex' | 'quoted-numeric-hex' | 'never' | 'off'; +export type RuleColorCase = 'upper' | 'lower' | 'off'; +export type RuleColorAlpha = 'always' | 'allowed' | 'never' | 'off'; +export type RuleColorAlphaDefaults = 'allowed' | 'only-hidden' | 'never' | 'off'; +export type RuleColorCertCompliant = 'always' | 'off'; // Roku cert requirement for broadcast safe colors. 6.4 export type BsLintConfig = Pick & { lintConfig?: string; @@ -39,6 +44,11 @@ export type BsLintConfig = Pick ({ + severity: DiagnosticSeverity.Error, + code: CodeStyleError.ColorFormat, + source: 'bslint', + message: `${CS} File should follow color format`, + range + }), + expectedColorCase: (range: Range) => ({ + severity: DiagnosticSeverity.Error, + code: CodeStyleError.ColorCase, + source: 'bslint', + message: `${CS} File should follow color case`, + range + }), + expectedColorAlpha: (range: Range) => ({ + severity: DiagnosticSeverity.Error, + code: CodeStyleError.ColorAlpha, + source: 'bslint', + message: `${CS} File should follow color alpha rule`, + range + }), + expectedColorAlphaDefaults: (range: Range) => ({ + severity: DiagnosticSeverity.Error, + code: CodeStyleError.ColorAlphaDefaults, + source: 'bslint', + message: `${CS} File should follow color alpha defaults rule`, + range + }), + colorCertCompliance: (range: Range) => ({ + severity: DiagnosticSeverity.Error, + code: CodeStyleError.ColorCertCompliant, + source: 'bslint', + message: `${CS} File should follow Roku broadcast safe color cert requirement`, + range }) }; diff --git a/src/plugins/codeStyle/index.spec.ts b/src/plugins/codeStyle/index.spec.ts index 3136b3f..ca80595 100644 --- a/src/plugins/codeStyle/index.spec.ts +++ b/src/plugins/codeStyle/index.spec.ts @@ -3,19 +3,62 @@ import { expect } from 'chai'; import { AALiteralExpression, AssignmentStatement, ParseMode, Parser, Program, util } from 'brighterscript'; import Linter from '../../Linter'; import CodeStyle, { collectWrappingAAMembersIndexes } from './index'; +import bslintFactory, { BsLintConfig } from '../../index'; import { createContext, PluginWrapperContext } from '../../util'; -import { fmtDiagnostics } from '../../testHelpers.spec'; +import { expectDiagnostics, expectDiagnosticsFmt, fmtDiagnostics } from '../../testHelpers.spec'; +import { messages } from './diagnosticMessages'; describe('codeStyle', () => { let linter: Linter; let lintContext: PluginWrapperContext; + let program: Program; const project1 = { rootDir: 'test/project1' }; + /** + * By default, all rules are off. So turn on the ones you care about for this test + */ + function init(rules?: BsLintConfig['rules']) { + program = new Program({ + rules: { + 'assign-all-paths': 'off', + 'unsafe-path-loop': 'off', + 'unsafe-iterators': 'off', + 'unreachable-code': 'off', + 'case-sensitivity': 'off', + 'unused-variable': 'off', + 'consistent-return': 'off', + 'no-stop': 'off', + 'inline-if-style': 'off', + 'block-if-style': 'off', + 'condition-style': 'off', + 'named-function-style': 'off', + 'anon-function-style': 'off', + 'aa-comma-style': 'off', + 'type-annotations': 'off', + 'no-print': 'off', + 'no-todo': 'off', + 'todo-pattern': 'off', + 'eol-last': 'off', + 'color-format': 'off', + 'color-case': 'off', + 'color-alpha': 'off', + 'color-alpha-defaults': 'off', + 'color-cert': 'off', + ...(rules ?? {}) + } + } as BsLintConfig); + program.plugins.add(bslintFactory()); + program.plugins.emit('afterProgramCreate', program); + return program; + } + beforeEach(() => { linter = new Linter(); + init(); + linter.builder.plugins.add({ name: 'test', afterProgramCreate: (program: Program) => { @@ -591,6 +634,282 @@ describe('codeStyle', () => { }); }); + describe('color-format', () => { + it('finds colors in various templateString expression styles', () => { + /* eslint-disable no-template-curly-in-string */ + + doTest('print `0xffffff`', [7, 15]); // string-like + doTest('print `${"0xffffff"}`', [9, 19]); // expression with a string in it + doTest('print `0xffffff${"0xffffff"}`', [17, 27]); // color then expression + doTest('print `${"0xffffff"}0xffffff`', [9, 19]); // expression then color + doTest('print `${"0xffffff"}0xffffff${"0xffffff"}`', [9, 19], [29, 39]); // expression then color then expression + doTest('print `0xffffff${"0xffffff"}0xffffff`', [17, 27]); // color then expression then color + + function doTest(code: string, ...diagnosticCharLocations: Array<[startChar: number, endChar: number]>) { + init({ + 'color-format': 'quoted-numeric-hex', + 'color-case': 'upper' + }); + program.setFile( + 'source/main.bs', + `sub init()\n${code}\nend sub` + ); + program.validate(); + expectDiagnostics( + program, + diagnosticCharLocations.map(x => messages.expectedColorCase(util.createRange(1, x[0], 1, x[1]))) + ); + } + /* eslint-enable no-template-curly-in-string */ + }); + + it('quoted-numeric-hex & uppercase', () => { + init({ + 'color-format': 'quoted-numeric-hex', + 'color-case': 'upper' + }); + program.setFile('source/main.brs', ` + sub init() + colors = ["0xff0000", "0x00FF00"] + nonValidColorsWrongColorFormat = [ + "#xxffff" ' this string is skipped because xx is not valid hex + ] + end sub + `); + program.validate(); + expectDiagnosticsFmt(program, [ + '03:LINT3020:Code style: File should follow color case' + ]); + }); + + it('hash-hex & lowercase', () => { + init({ + 'color-format': 'hash-hex', + 'color-case': 'lower' + }); + program.setFile('source/main.brs', ` + sub init() + colors = { + value1: "#0000ff", + value2: "#00FFff", + value3: "#ff0000", + shortFormColorHash: "#f0F" + } + end sub + `); + program.validate(); + expectDiagnosticsFmt(program, [ + '05:LINT3020:Code style: File should follow color case' + ]); + }); + + it('has-hex & lowercase & template strings', () => { + init({ + 'color-format': 'hash-hex', + 'color-case': 'lower' + }); + program.setFile('source/main.bs', ` + sub init() + colors = { + value1: \`#00FFff\`, + value2: \`#0000ff\`, + value3: \`#ff0000\`, + value4: \`#ff00FF\`, + shortFormColorHash: \`#f0F\` + } + end sub + `); + program.validate(); + expectDiagnosticsFmt(program, [ + '04:LINT3020:Code style: File should follow color case', + '07:LINT3020:Code style: File should follow color case' + ]); + }); + + it('BRS file color format is none - no color values found', () => { + init({ + 'color-format': 'never' + }); + program.setFile('source/main.bs', ` + sub init() + colorLengthStringNoColorValues = "abcdefg" + colorLengthStringInvalidColorValues = "0xxx0000" + shortFormColorHash = "#f00" + shortFormColorQuoteNumeric = "0xf00" + + colorLengthStringNoColorValues = \`abcdefg\` + colorLengthStringInvalidColorValues = \`0xxx0000\` + shortFormColorHash = \`#f00\` + shortFormColorQuoteNumeric = \`0xf00\` + end sub + `); + expectDiagnosticsFmt(program, []); + }); + + it('color-format:never but color values found', () => { + init({ + 'color-format': 'never' + }); + program.setFile('source/main.bs', ` + sub init() + colors = { + value1: "#0000ff", + value2: "#00FFff", + value3: "#ff0000", + shortFormColorHash: "#f0F" + } + end sub + `); + program.validate(); + expectDiagnosticsFmt(program, [ + '04:LINT3019:Code style: File should follow color format', + '05:LINT3019:Code style: File should follow color format', + '06:LINT3019:Code style: File should follow color format' + ]); + }); + + it('quoted-numeric-hex & color-cert:always', () => { + init({ + 'color-format': 'quoted-numeric-hex', + 'color-cert': 'always' + }); + program.setFile('source/main.bs', ` + sub init() + color = "0xDBDBDC" + color = "0x161616" + color = "0xDBDBDBFF" + color = "0x161615" + longStringWithColors = "Long string value with 0x161615 non broadcast safe color values defined" + end sub + `); + program.validate(); + expectDiagnosticsFmt(program, [ + '03:LINT3023:Code style: File should follow Roku broadcast safe color cert requirement', + '06:LINT3023:Code style: File should follow Roku broadcast safe color cert requirement' + ]); + }); + + it('quoted-numeric-hex & color-cert:off', () => { + init({ + 'color-format': 'quoted-numeric-hex', + 'color-cert': 'off' + }); + program.setFile('source/main.bs', ` + sub init() + color = "0xDBDBDC" + color = "0x161616" + color = "0xDBDBDBFF" + color = "0x161615" + longStringWithColors = "Long string value with 0x161615 non broadcast safe color values defined" + end sub + `); + program.validate(); + expectDiagnosticsFmt(program, []); + }); + + it('quoted-numeric-hex, color-alpha:allowed, color-alpha-defaults:never', () => { + init({ + 'color-format': 'quoted-numeric-hex', + 'color-alpha': 'allowed', + 'color-alpha-defaults': 'never' + }); + program.setFile('source/main.bs', ` + sub init() + color = "0xf00000" + color = "0xff0000cc" + color = "0xfff000" + color = "0xffff0000" + color = "0xfffff0FF" + colorLengthStringNoColorValues = "abcdefg" + colorLengthStringInvalidColorValues = "0xxx0000" + shortFormColorHash = "#f00" + shortFormColorQuoteNumeric = "0xf00" + end sub + `); + program.validate(); + expectDiagnosticsFmt(program, [ + '06:LINT3022:Code style: File should follow color alpha defaults rule', + '07:LINT3022:Code style: File should follow color alpha defaults rule' + ]); + }); + + it('quoted-numeric-hex, alpha values are allowed and only hidden alpha (00) defaults are allowed', () => { + init({ + 'color-format': 'quoted-numeric-hex', + 'color-alpha': 'allowed', + 'color-alpha-defaults': 'only-hidden' + }); + program.setFile('source/main.bs', ` + sub init() + color = "0xf00000" + color = "0xff0000cc" + color = "0xfff000" + color = "0xffff0000" + color = "0xfffff0FF" + colorLengthStringNoColorValues = "abcdefg" + colorLengthStringInvalidColorValues = "0xxx0000" + shortFormColorHash = "#f00" + shortFormColorQuoteNumeric = "0xf00" + end sub + `); + program.validate(); + expectDiagnosticsFmt(program, [ + '07:LINT3022:Code style: File should follow color alpha defaults rule' + ]); + }); + + it('quoted-numeric-hex and alpha values are not allowed', () => { + init({ + 'color-format': 'quoted-numeric-hex', + 'color-alpha': 'never' + }); + program.setFile('source/main.bs', ` + sub init() + color = "0xf00000" + color = "0xff0000cc" + color = "0xfff000" + color = "0xffff0000" + color = "0xfffff0FF" + colorLengthStringNoColorValues = "abcdefg" + colorLengthStringInvalidColorValues = "0xxx0000" + shortFormColorHash = "#f00" + shortFormColorQuoteNumeric = "0xf00" + end sub + `); + program.validate(); + expectDiagnosticsFmt(program, [ + '04:LINT3021:Code style: File should follow color alpha rule', + '06:LINT3021:Code style: File should follow color alpha rule', + '07:LINT3021:Code style: File should follow color alpha rule' + ]); + }); + + it('quoted-numeric-hex and alpha values are required', () => { + init({ + 'color-format': 'quoted-numeric-hex', + 'color-alpha': 'always' + }); + program.setFile('source/main.bs', ` + sub init() + color = "0xf00000" + color = "0xff0000cc" + color = "0xfff000" + color = "0xffff0000" + color = "0xfffff0FF" + colorLengthStringNoColorValues = "abcdefg" + colorLengthStringInvalidColorValues = "0xxx0000" + shortFormColorHash = "#f00" + shortFormColorQuoteNumeric = "0xf00" + end sub + `); + program.validate(); + expectDiagnosticsFmt(program, [ + '03:LINT3021:Code style: File should follow color alpha rule', + '05:LINT3021:Code style: File should follow color alpha rule' + ]); + }); + }); + describe('fix', () => { // Filenames (without the extension) that we want to copy with a "-temp" suffix const tmpFileNames = [ diff --git a/src/plugins/codeStyle/index.ts b/src/plugins/codeStyle/index.ts index cec73ad..7dd4a27 100644 --- a/src/plugins/codeStyle/index.ts +++ b/src/plugins/codeStyle/index.ts @@ -2,6 +2,7 @@ import { BscFile, BsDiagnostic, createVisitor, FunctionExpression, isBrsFile, is import { RuleAAComma } from '../..'; import { addFixesToEvent } from '../../textEdit'; import { PluginContext } from '../../util'; +import { createColorValidator } from '../../createColorValidator'; import { messages } from './diagnosticMessages'; import { extractFixes } from './styleFixes'; @@ -24,11 +25,12 @@ export default class CodeStyle { const diagnostics: (Omit)[] = []; const { severity, fix } = this.lintContext; - const { inlineIfStyle, blockIfStyle, conditionStyle, noPrint, noTodo, noStop, aaCommaStyle, eolLast } = severity; + const { inlineIfStyle, blockIfStyle, conditionStyle, noPrint, noTodo, noStop, aaCommaStyle, eolLast, colorFormat } = severity; const validatePrint = noPrint !== DiagnosticSeverity.Hint; const validateTodo = noTodo !== DiagnosticSeverity.Hint; const validateNoStop = noStop !== DiagnosticSeverity.Hint; const validateInlineIf = inlineIfStyle !== 'off'; + const validateColorFormat = (colorFormat === 'hash-hex' || colorFormat === 'quoted-numeric-hex' || colorFormat === 'never'); const disallowInlineIf = inlineIfStyle === 'never'; const requireInlineIfThen = inlineIfStyle === 'then'; const validateBlockIf = blockIfStyle !== 'off'; @@ -36,9 +38,10 @@ export default class CodeStyle { const validateCondition = conditionStyle !== 'off'; const requireConditionGroup = conditionStyle === 'group'; const validateAAStyle = aaCommaStyle !== 'off'; - const walkExpressions = validateAAStyle; + const walkExpressions = validateAAStyle || validateColorFormat; const validateEolLast = eolLast !== 'off'; const disallowEolLast = eolLast === 'never'; + const validateColorStyle = validateColorFormat ? createColorValidator(severity) : undefined; // Check if the file is empty by going backwards from the last token, // meaning there are tokens other than `Eof` and `Newline`. @@ -125,6 +128,17 @@ export default class CodeStyle { diagnostics.push(messages.noPrint(s.tokens.print.range, noPrint)); } }, + LiteralExpression: e => { + if (validateColorStyle && e.token.kind === TokenKind.StringLiteral) { + validateColorStyle(e.token.text, e.token.range, diagnostics); + } + }, + TemplateStringExpression: e => { + // only validate template strings that look like regular strings (i.e. `0xAABBCC`) + if (validateColorStyle && e.quasis.length === 1 && e.quasis[0].expressions.length === 1) { + validateColorStyle(e.quasis[0].expressions[0].token.text, e.quasis[0].expressions[0].token.range, diagnostics); + } + }, AALiteralExpression: e => { if (validateAAStyle) { this.validateAAStyle(e, aaCommaStyle, diagnostics); diff --git a/src/plugins/codeStyle/styleFixes.ts b/src/plugins/codeStyle/styleFixes.ts index 7b0a2cc..c71de52 100644 --- a/src/plugins/codeStyle/styleFixes.ts +++ b/src/plugins/codeStyle/styleFixes.ts @@ -79,7 +79,7 @@ function addConditionGroup(diagnostic: BsDiagnostic) { } function removeConditionGroup(diagnostic: BsDiagnostic) { - const stat: (IfStatement | WhileStatement) & { condition: GroupingExpression} = diagnostic.data; + const stat: (IfStatement | WhileStatement) & { condition: GroupingExpression } = diagnostic.data; const { left, right } = stat.condition.tokens; const spaceBefore = left.leadingWhitespace?.length > 0 ? '' : ' '; let spaceAfter = ''; diff --git a/src/util.ts b/src/util.ts index f0d6818..d737026 100644 --- a/src/util.ts +++ b/src/util.ts @@ -157,7 +157,12 @@ function rulesToSeverity(rules: BsLintConfig['rules']) { noPrint: ruleToSeverity(rules['no-print']), noTodo: ruleToSeverity(rules['no-todo']), noStop: ruleToSeverity(rules['no-stop']), - eolLast: rules['eol-last'] + eolLast: rules['eol-last'], + colorFormat: rules['color-format'], + colorCase: rules['color-case'], + colorAlpha: rules['color-alpha'], + colorAlphaDefaults: rules['color-alpha-defaults'], + colorCertCompliant: rules['color-cert'] }; } From a626cd9b54134f6c099418545003534871cdf45f Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Sun, 8 Oct 2023 06:49:42 -0400 Subject: [PATCH 03/15] Update changelog for v0.8.11 --- CHANGELOG.md | 20 +++++++++++++++++++- package-lock.json | 14 +++++++------- package.json | 2 +- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 499ed13..ca52c16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +## [0.8.11](https://github.com/rokucommunity/bslint/compare/v0.8.10...v0.8.11) - 2023-10-08 +### Added + - color format checking for bslint ([#94](https://github.com/rokucommunity/bslint/pull/94)) +### Changed + - chore: copy expectDiagnostics from brighterscript for tests ([#95](https://github.com/rokucommunity/bslint/pull/95)) + - upgrade to [brighterscript@0.65.8](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#0658---2023-10-06). Notable changes since 0.65.5: + - Bump postcss from 8.2.15 to 8.4.31 ([brighterscript#928](https://github.com/rokucommunity/brighterscript/pull/928)) + - Add interface parameter support ([brighterscript#924](https://github.com/rokucommunity/brighterscript/pull/924)) + - chore: better typing for `Deferred` ([brighterscript#923](https://github.com/rokucommunity/brighterscript/pull/923)) + - chore: add missing emitDefinitions to docs and fix iface ([brighterscript#893](https://github.com/rokucommunity/brighterscript/pull/893)) + - Add some more details to the plugins docs ([brighterscript#913](https://github.com/rokucommunity/brighterscript/pull/913)) + - Fix incorrect quasi location in template string ([brighterscript#921](https://github.com/rokucommunity/brighterscript/pull/921)) + - Fix UnaryExpression transpile for ns and const ([brighterscript#914](https://github.com/rokucommunity/brighterscript/pull/914)) + - fix bug in --noproject flag logic ([brighterscript#922](https://github.com/rokucommunity/brighterscript/pull/922)) + - add noProject flag to bsc so BSConfig.json not expected ([brighterscript#868](https://github.com/rokucommunity/brighterscript/pull/868)) + + + ## [0.8.10](https://github.com/rokucommunity/bslint/compare/v0.8.9...v0.8.10) - 2023-09-11 ### Changed - upgrade to [brighterscript@0.65.5](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#0655---2023-09-06). Notable changes since 0.65.4: @@ -260,4 +278,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.1.0](https://github.com/rokucommunity/bslint/compare/213c530d29ff49771da2860cf4cae79c5341e8cb...v0.1.0) - 2021-02-22 ### Added -Initial release \ No newline at end of file +Initial release diff --git a/package-lock.json b/package-lock.json index 15fc1d7..89e3468 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "@types/node": "^14.6.0", "@typescript-eslint/eslint-plugin": "^3.10.1", "@typescript-eslint/parser": "^3.10.1", - "brighterscript": "^0.65.5", + "brighterscript": "^0.65.8", "chai": "^4.3.6", "coveralls": "^3.1.1", "eslint": "^7.7.0", @@ -1025,9 +1025,9 @@ } }, "node_modules/brighterscript": { - "version": "0.65.5", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.5.tgz", - "integrity": "sha512-xDkWIZhjTLhp6dVZ6lX7zWRyNvjdiAwZncJRnErSbqRhteNJFL7ic2UDJew9zCOYTQDrG7B85lpPpXc/1JlV+Q==", + "version": "0.65.8", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.8.tgz", + "integrity": "sha512-mqarSnGCl/VSTRj1oY9wRMZJV9s8dH+rZZ2P1yE7d1nZQucVpAIGICW83G9AJHQYUDjrGsKHn5UfAfaZaE1KCA==", "dev": true, "dependencies": { "@rokucommunity/bslib": "^0.1.1", @@ -5806,9 +5806,9 @@ } }, "brighterscript": { - "version": "0.65.5", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.5.tgz", - "integrity": "sha512-xDkWIZhjTLhp6dVZ6lX7zWRyNvjdiAwZncJRnErSbqRhteNJFL7ic2UDJew9zCOYTQDrG7B85lpPpXc/1JlV+Q==", + "version": "0.65.8", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.8.tgz", + "integrity": "sha512-mqarSnGCl/VSTRj1oY9wRMZJV9s8dH+rZZ2P1yE7d1nZQucVpAIGICW83G9AJHQYUDjrGsKHn5UfAfaZaE1KCA==", "dev": true, "requires": { "@rokucommunity/bslib": "^0.1.1", diff --git a/package.json b/package.json index 1331443..b67e39f 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@types/node": "^14.6.0", "@typescript-eslint/eslint-plugin": "^3.10.1", "@typescript-eslint/parser": "^3.10.1", - "brighterscript": "^0.65.5", + "brighterscript": "^0.65.8", "chai": "^4.3.6", "coveralls": "^3.1.1", "eslint": "^7.7.0", From 051fd4caca2e73d0cc013d9b9bc7e67ddb9a1687 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Sun, 8 Oct 2023 06:51:08 -0400 Subject: [PATCH 04/15] Fixing issues before release 0.8.11 --- src/plugins/codeStyle/index.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/codeStyle/index.spec.ts b/src/plugins/codeStyle/index.spec.ts index ca80595..86ee41e 100644 --- a/src/plugins/codeStyle/index.spec.ts +++ b/src/plugins/codeStyle/index.spec.ts @@ -642,7 +642,7 @@ describe('codeStyle', () => { doTest('print `${"0xffffff"}`', [9, 19]); // expression with a string in it doTest('print `0xffffff${"0xffffff"}`', [17, 27]); // color then expression doTest('print `${"0xffffff"}0xffffff`', [9, 19]); // expression then color - doTest('print `${"0xffffff"}0xffffff${"0xffffff"}`', [9, 19], [29, 39]); // expression then color then expression + doTest('print `${"0xffffff"}0xffffff${"0xffffff"}`', [9, 19], [30, 40]); // expression then color then expression doTest('print `0xffffff${"0xffffff"}0xffffff`', [17, 27]); // color then expression then color function doTest(code: string, ...diagnosticCharLocations: Array<[startChar: number, endChar: number]>) { From 82df0acd52c9c8276b99e0df66d90e26e4a649f7 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Sun, 8 Oct 2023 06:51:20 -0400 Subject: [PATCH 05/15] 0.8.11 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 89e3468..57d446a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rokucommunity/bslint", - "version": "0.8.10", + "version": "0.8.11", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@rokucommunity/bslint", - "version": "0.8.10", + "version": "0.8.11", "license": "MIT", "dependencies": { "fs-extra": "^10.0.0", diff --git a/package.json b/package.json index b67e39f..76f2ae3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rokucommunity/bslint", - "version": "0.8.10", + "version": "0.8.11", "description": "BrighterScript linter plugin", "main": "dist/index.js", "bin": { From 8bb7956868deace8e304d433482d376890c719a3 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Wed, 8 Nov 2023 08:12:02 -0500 Subject: [PATCH 06/15] Update changelog for v0.8.12 --- CHANGELOG.md | 7 +++++ package-lock.json | 68 ++++++++++++++++++++++++----------------------- package.json | 2 +- 3 files changed, 43 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca52c16..67ba0d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +## [0.8.12](https://github.com/rokucommunity/bslint/compare/v0.8.11...v0.8.12) - 2023-11-08 +### Changed + - upgrade to [brighterscript@0.65.9](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#0659---2023-11-06). Notable changes since 0.65.8: + - Fix issue with unary expression parsing ([brighterscript#938](https://github.com/rokucommunity/brighterscript/pull/938)) + + + ## [0.8.11](https://github.com/rokucommunity/bslint/compare/v0.8.10...v0.8.11) - 2023-10-08 ### Added - color format checking for bslint ([#94](https://github.com/rokucommunity/bslint/pull/94)) diff --git a/package-lock.json b/package-lock.json index 57d446a..617413a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "@types/node": "^14.6.0", "@typescript-eslint/eslint-plugin": "^3.10.1", "@typescript-eslint/parser": "^3.10.1", - "brighterscript": "^0.65.8", + "brighterscript": "^0.65.9", "chai": "^4.3.6", "coveralls": "^3.1.1", "eslint": "^7.7.0", @@ -1025,9 +1025,9 @@ } }, "node_modules/brighterscript": { - "version": "0.65.8", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.8.tgz", - "integrity": "sha512-mqarSnGCl/VSTRj1oY9wRMZJV9s8dH+rZZ2P1yE7d1nZQucVpAIGICW83G9AJHQYUDjrGsKHn5UfAfaZaE1KCA==", + "version": "0.65.9", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.9.tgz", + "integrity": "sha512-cjJmftkY+2A5HrGIbmRz2fylywEwj3+Y/EXeSx4TJsEvOW0/M61G5gHRdGyqPF/TMEGlPHGlTBAmPdOMi85+xw==", "dev": true, "dependencies": { "@rokucommunity/bslib": "^0.1.1", @@ -1053,7 +1053,7 @@ "parse-ms": "^2.1.0", "readline": "^1.3.0", "require-relative": "^0.8.7", - "roku-deploy": "^3.10.3", + "roku-deploy": "^3.10.4", "serialize-error": "^7.0.1", "source-map": "^0.7.4", "vscode-languageserver": "7.0.0", @@ -1522,9 +1522,9 @@ } }, "node_modules/dayjs": { - "version": "1.11.9", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.9.tgz", - "integrity": "sha512-QvzAURSbQ0pKdIye2txOzNaHmxtUBXerpY0FJsFXUMKbIZeFm5ht1LS/jFsrncjnmtv8HsG0W2g6c0zUjZWmpA==", + "version": "1.11.10", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", + "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==", "dev": true }, "node_modules/debounce-promise": { @@ -2009,9 +2009,9 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -4056,9 +4056,9 @@ } }, "node_modules/roku-deploy": { - "version": "3.10.3", - "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.10.3.tgz", - "integrity": "sha512-COJSQ638QklcM+8AN1nujFuzT04rTZLFuLSww35edm8w/y0l60oF/Iu7TQ46m75DwoGFzGFfomLEmA1ltQk9mA==", + "version": "3.10.4", + "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.10.4.tgz", + "integrity": "sha512-Drl0c78HjZejaC0zovm4f/pJRCw0DbbBzR5Pe+ADKlMfOSJuF4UvNaejJzgbTcGXKkeztgOBvu5xxpOL7gqhWQ==", "dev": true, "dependencies": { "chalk": "^2.4.2", @@ -4069,6 +4069,7 @@ "is-glob": "^4.0.3", "jsonc-parser": "^2.3.0", "jszip": "^3.6.0", + "lodash": "^4.17.21", "micromatch": "^4.0.4", "moment": "^2.29.1", "parse-ms": "^2.1.0", @@ -4148,9 +4149,9 @@ "dev": true }, "node_modules/sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", + "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==", "dev": true }, "node_modules/semver": { @@ -5806,9 +5807,9 @@ } }, "brighterscript": { - "version": "0.65.8", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.8.tgz", - "integrity": "sha512-mqarSnGCl/VSTRj1oY9wRMZJV9s8dH+rZZ2P1yE7d1nZQucVpAIGICW83G9AJHQYUDjrGsKHn5UfAfaZaE1KCA==", + "version": "0.65.9", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.9.tgz", + "integrity": "sha512-cjJmftkY+2A5HrGIbmRz2fylywEwj3+Y/EXeSx4TJsEvOW0/M61G5gHRdGyqPF/TMEGlPHGlTBAmPdOMi85+xw==", "dev": true, "requires": { "@rokucommunity/bslib": "^0.1.1", @@ -5834,7 +5835,7 @@ "parse-ms": "^2.1.0", "readline": "^1.3.0", "require-relative": "^0.8.7", - "roku-deploy": "^3.10.3", + "roku-deploy": "^3.10.4", "serialize-error": "^7.0.1", "source-map": "^0.7.4", "vscode-languageserver": "7.0.0", @@ -6212,9 +6213,9 @@ "dev": true }, "dayjs": { - "version": "1.11.9", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.9.tgz", - "integrity": "sha512-QvzAURSbQ0pKdIye2txOzNaHmxtUBXerpY0FJsFXUMKbIZeFm5ht1LS/jFsrncjnmtv8HsG0W2g6c0zUjZWmpA==", + "version": "1.11.10", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", + "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==", "dev": true }, "debounce-promise": { @@ -6570,9 +6571,9 @@ "dev": true }, "fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -8116,9 +8117,9 @@ } }, "roku-deploy": { - "version": "3.10.3", - "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.10.3.tgz", - "integrity": "sha512-COJSQ638QklcM+8AN1nujFuzT04rTZLFuLSww35edm8w/y0l60oF/Iu7TQ46m75DwoGFzGFfomLEmA1ltQk9mA==", + "version": "3.10.4", + "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.10.4.tgz", + "integrity": "sha512-Drl0c78HjZejaC0zovm4f/pJRCw0DbbBzR5Pe+ADKlMfOSJuF4UvNaejJzgbTcGXKkeztgOBvu5xxpOL7gqhWQ==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -8129,6 +8130,7 @@ "is-glob": "^4.0.3", "jsonc-parser": "^2.3.0", "jszip": "^3.6.0", + "lodash": "^4.17.21", "micromatch": "^4.0.4", "moment": "^2.29.1", "parse-ms": "^2.1.0", @@ -8187,9 +8189,9 @@ "dev": true }, "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", + "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==", "dev": true }, "semver": { diff --git a/package.json b/package.json index 76f2ae3..1916ec3 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@types/node": "^14.6.0", "@typescript-eslint/eslint-plugin": "^3.10.1", "@typescript-eslint/parser": "^3.10.1", - "brighterscript": "^0.65.8", + "brighterscript": "^0.65.9", "chai": "^4.3.6", "coveralls": "^3.1.1", "eslint": "^7.7.0", From c1ff2e6350422fa730f62b193baa873116781e21 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Wed, 8 Nov 2023 08:12:24 -0500 Subject: [PATCH 07/15] 0.8.12 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 617413a..125ca5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rokucommunity/bslint", - "version": "0.8.11", + "version": "0.8.12", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@rokucommunity/bslint", - "version": "0.8.11", + "version": "0.8.12", "license": "MIT", "dependencies": { "fs-extra": "^10.0.0", diff --git a/package.json b/package.json index 1916ec3..c530c88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rokucommunity/bslint", - "version": "0.8.11", + "version": "0.8.12", "description": "BrighterScript linter plugin", "main": "dist/index.js", "bin": { From 56b8a47e52f586636cc97620f3479374ffe39272 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Thu, 7 Dec 2023 13:31:57 -0500 Subject: [PATCH 08/15] Update changelog for v0.8.13 --- CHANGELOG.md | 12 ++++++++++++ package-lock.json | 30 +++++++++++++++--------------- package.json | 2 +- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67ba0d3..e9d6b4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +## [0.8.13](https://github.com/rokucommunity/bslint/compare/v0.8.12...v0.8.13) - 2023-12-07 +### Changed + - upgrade to [brighterscript@0.65.12](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#06512---2023-12-07). Notable changes since 0.65.9: + - Add `optional` modifier for interface and class members ([brighterscript#955](https://github.com/rokucommunity/brighterscript/pull/955)) + - Use regex for faster manifest/typedef detection ([brighterscript#976](https://github.com/rokucommunity/brighterscript/pull/976)) + - fix the create-package script ([brighterscript#974](https://github.com/rokucommunity/brighterscript/pull/974)) + - Correct RANGE in template string when dealing with quotes in annotations ([brighterscript#975](https://github.com/rokucommunity/brighterscript/pull/975)) + - Add manifest loading from files ([brighterscript#942](https://github.com/rokucommunity/brighterscript/pull/942)) + - Enums as class initial values ([brighterscript#950](https://github.com/rokucommunity/brighterscript/pull/950)) + + + ## [0.8.12](https://github.com/rokucommunity/bslint/compare/v0.8.11...v0.8.12) - 2023-11-08 ### Changed - upgrade to [brighterscript@0.65.9](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#0659---2023-11-06). Notable changes since 0.65.8: diff --git a/package-lock.json b/package-lock.json index 125ca5f..29f629f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "@types/node": "^14.6.0", "@typescript-eslint/eslint-plugin": "^3.10.1", "@typescript-eslint/parser": "^3.10.1", - "brighterscript": "^0.65.9", + "brighterscript": "^0.65.12", "chai": "^4.3.6", "coveralls": "^3.1.1", "eslint": "^7.7.0", @@ -1025,9 +1025,9 @@ } }, "node_modules/brighterscript": { - "version": "0.65.9", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.9.tgz", - "integrity": "sha512-cjJmftkY+2A5HrGIbmRz2fylywEwj3+Y/EXeSx4TJsEvOW0/M61G5gHRdGyqPF/TMEGlPHGlTBAmPdOMi85+xw==", + "version": "0.65.12", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.12.tgz", + "integrity": "sha512-sXPLEH2CgjrPLFWi9tp2PXTNjS1S/6Xoa6EmafFauzYJBgXPKJd/ajzRNs5UPIJ4pqG0cst6NDWDHm7y2y4nEw==", "dev": true, "dependencies": { "@rokucommunity/bslib": "^0.1.1", @@ -1053,7 +1053,7 @@ "parse-ms": "^2.1.0", "readline": "^1.3.0", "require-relative": "^0.8.7", - "roku-deploy": "^3.10.4", + "roku-deploy": "^3.11.1", "serialize-error": "^7.0.1", "source-map": "^0.7.4", "vscode-languageserver": "7.0.0", @@ -4056,9 +4056,9 @@ } }, "node_modules/roku-deploy": { - "version": "3.10.4", - "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.10.4.tgz", - "integrity": "sha512-Drl0c78HjZejaC0zovm4f/pJRCw0DbbBzR5Pe+ADKlMfOSJuF4UvNaejJzgbTcGXKkeztgOBvu5xxpOL7gqhWQ==", + "version": "3.11.1", + "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.11.1.tgz", + "integrity": "sha512-ri3eJKGyPMexI+pwvBQxpi6I7I3z9670yOidTcVEohpbYhXpnaIHnKdLb2l87kuC+iTtIEsElgmx3fyEdI5Cjg==", "dev": true, "dependencies": { "chalk": "^2.4.2", @@ -5807,9 +5807,9 @@ } }, "brighterscript": { - "version": "0.65.9", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.9.tgz", - "integrity": "sha512-cjJmftkY+2A5HrGIbmRz2fylywEwj3+Y/EXeSx4TJsEvOW0/M61G5gHRdGyqPF/TMEGlPHGlTBAmPdOMi85+xw==", + "version": "0.65.12", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.12.tgz", + "integrity": "sha512-sXPLEH2CgjrPLFWi9tp2PXTNjS1S/6Xoa6EmafFauzYJBgXPKJd/ajzRNs5UPIJ4pqG0cst6NDWDHm7y2y4nEw==", "dev": true, "requires": { "@rokucommunity/bslib": "^0.1.1", @@ -5835,7 +5835,7 @@ "parse-ms": "^2.1.0", "readline": "^1.3.0", "require-relative": "^0.8.7", - "roku-deploy": "^3.10.4", + "roku-deploy": "^3.11.1", "serialize-error": "^7.0.1", "source-map": "^0.7.4", "vscode-languageserver": "7.0.0", @@ -8117,9 +8117,9 @@ } }, "roku-deploy": { - "version": "3.10.4", - "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.10.4.tgz", - "integrity": "sha512-Drl0c78HjZejaC0zovm4f/pJRCw0DbbBzR5Pe+ADKlMfOSJuF4UvNaejJzgbTcGXKkeztgOBvu5xxpOL7gqhWQ==", + "version": "3.11.1", + "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.11.1.tgz", + "integrity": "sha512-ri3eJKGyPMexI+pwvBQxpi6I7I3z9670yOidTcVEohpbYhXpnaIHnKdLb2l87kuC+iTtIEsElgmx3fyEdI5Cjg==", "dev": true, "requires": { "chalk": "^2.4.2", diff --git a/package.json b/package.json index c530c88..13223f8 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@types/node": "^14.6.0", "@typescript-eslint/eslint-plugin": "^3.10.1", "@typescript-eslint/parser": "^3.10.1", - "brighterscript": "^0.65.9", + "brighterscript": "^0.65.12", "chai": "^4.3.6", "coveralls": "^3.1.1", "eslint": "^7.7.0", From 8908762bb9b7f5b5bbe6240809aad153bc01c415 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Thu, 7 Dec 2023 13:32:17 -0500 Subject: [PATCH 09/15] 0.8.13 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 29f629f..0b3b683 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rokucommunity/bslint", - "version": "0.8.12", + "version": "0.8.13", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@rokucommunity/bslint", - "version": "0.8.12", + "version": "0.8.13", "license": "MIT", "dependencies": { "fs-extra": "^10.0.0", diff --git a/package.json b/package.json index 13223f8..0b9f0bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rokucommunity/bslint", - "version": "0.8.12", + "version": "0.8.13", "description": "BrighterScript linter plugin", "main": "dist/index.js", "bin": { From b5e9ef640cfff7c61b1091611642ffe8a0d6b1fb Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Mon, 8 Jan 2024 10:43:30 -0500 Subject: [PATCH 10/15] Update changelog for v0.8.14 --- CHANGELOG.md | 12 +++++++++++ package-lock.json | 54 +++++++++++++++++++++++------------------------ package.json | 2 +- 3 files changed, 40 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9d6b4b..3ad5185 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +## [0.8.14](https://github.com/rokucommunity/bslint/compare/v0.8.13...v0.8.14) - 2024-01-08 +### Changed + - upgrade to [brighterscript@0.65.16](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#06516---2024-01-08). Notable changes since 0.65.12: + - Prevent publishing of empty files ([brighterscript#997](https://github.com/rokucommunity/brighterscript/pull/997)) + - Improve null safety ([brighterscript#996](https://github.com/rokucommunity/brighterscript/pull/996)) + - Prevent errors when using enums in a file that's not included in any scopes ([brighterscript#995](https://github.com/rokucommunity/brighterscript/pull/995)) + - Fix multi-namespace class inheritance transpile bug ([brighterscript#990](https://github.com/rokucommunity/brighterscript/pull/990)) + - Add check for onChange function ([brighterscript#941](https://github.com/rokucommunity/brighterscript/pull/941)) + - Fix broken enum transpiling ([brighterscript#985](https://github.com/rokucommunity/brighterscript/pull/985)) + + + ## [0.8.13](https://github.com/rokucommunity/bslint/compare/v0.8.12...v0.8.13) - 2023-12-07 ### Changed - upgrade to [brighterscript@0.65.12](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#06512---2023-12-07). Notable changes since 0.65.9: diff --git a/package-lock.json b/package-lock.json index 0b3b683..d11450e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "@types/node": "^14.6.0", "@typescript-eslint/eslint-plugin": "^3.10.1", "@typescript-eslint/parser": "^3.10.1", - "brighterscript": "^0.65.12", + "brighterscript": "^0.65.16", "chai": "^4.3.6", "coveralls": "^3.1.1", "eslint": "^7.7.0", @@ -1025,9 +1025,9 @@ } }, "node_modules/brighterscript": { - "version": "0.65.12", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.12.tgz", - "integrity": "sha512-sXPLEH2CgjrPLFWi9tp2PXTNjS1S/6Xoa6EmafFauzYJBgXPKJd/ajzRNs5UPIJ4pqG0cst6NDWDHm7y2y4nEw==", + "version": "0.65.16", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.16.tgz", + "integrity": "sha512-2RJMF8itkrPXtZ92JkJf3emvzcCl5ETXGVyPsdO/hMKbUGinEGMRFG07FR0bzjRotbALzsozGE/Hjzw412Sjww==", "dev": true, "dependencies": { "@rokucommunity/bslib": "^0.1.1", @@ -1053,7 +1053,7 @@ "parse-ms": "^2.1.0", "readline": "^1.3.0", "require-relative": "^0.8.7", - "roku-deploy": "^3.11.1", + "roku-deploy": "^3.11.2", "serialize-error": "^7.0.1", "source-map": "^0.7.4", "vscode-languageserver": "7.0.0", @@ -2037,9 +2037,9 @@ "dev": true }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz", + "integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -3384,9 +3384,9 @@ } }, "node_modules/moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", "dev": true, "engines": { "node": "*" @@ -4056,9 +4056,9 @@ } }, "node_modules/roku-deploy": { - "version": "3.11.1", - "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.11.1.tgz", - "integrity": "sha512-ri3eJKGyPMexI+pwvBQxpi6I7I3z9670yOidTcVEohpbYhXpnaIHnKdLb2l87kuC+iTtIEsElgmx3fyEdI5Cjg==", + "version": "3.11.2", + "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.11.2.tgz", + "integrity": "sha512-3JDlnbTxv6Xk5GVolQoA3+d34MLZXXwZWMySprHwazZoWLP3LvulYHP92YvFOJAo/aI4IZp/TFA8kR82IrmHKA==", "dev": true, "dependencies": { "chalk": "^2.4.2", @@ -5807,9 +5807,9 @@ } }, "brighterscript": { - "version": "0.65.12", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.12.tgz", - "integrity": "sha512-sXPLEH2CgjrPLFWi9tp2PXTNjS1S/6Xoa6EmafFauzYJBgXPKJd/ajzRNs5UPIJ4pqG0cst6NDWDHm7y2y4nEw==", + "version": "0.65.16", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.16.tgz", + "integrity": "sha512-2RJMF8itkrPXtZ92JkJf3emvzcCl5ETXGVyPsdO/hMKbUGinEGMRFG07FR0bzjRotbALzsozGE/Hjzw412Sjww==", "dev": true, "requires": { "@rokucommunity/bslib": "^0.1.1", @@ -5835,7 +5835,7 @@ "parse-ms": "^2.1.0", "readline": "^1.3.0", "require-relative": "^0.8.7", - "roku-deploy": "^3.11.1", + "roku-deploy": "^3.11.2", "serialize-error": "^7.0.1", "source-map": "^0.7.4", "vscode-languageserver": "7.0.0", @@ -6596,9 +6596,9 @@ "dev": true }, "fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz", + "integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -7604,9 +7604,9 @@ } }, "moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", "dev": true }, "ms": { @@ -8117,9 +8117,9 @@ } }, "roku-deploy": { - "version": "3.11.1", - "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.11.1.tgz", - "integrity": "sha512-ri3eJKGyPMexI+pwvBQxpi6I7I3z9670yOidTcVEohpbYhXpnaIHnKdLb2l87kuC+iTtIEsElgmx3fyEdI5Cjg==", + "version": "3.11.2", + "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.11.2.tgz", + "integrity": "sha512-3JDlnbTxv6Xk5GVolQoA3+d34MLZXXwZWMySprHwazZoWLP3LvulYHP92YvFOJAo/aI4IZp/TFA8kR82IrmHKA==", "dev": true, "requires": { "chalk": "^2.4.2", diff --git a/package.json b/package.json index 0b9f0bb..b8db88e 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@types/node": "^14.6.0", "@typescript-eslint/eslint-plugin": "^3.10.1", "@typescript-eslint/parser": "^3.10.1", - "brighterscript": "^0.65.12", + "brighterscript": "^0.65.16", "chai": "^4.3.6", "coveralls": "^3.1.1", "eslint": "^7.7.0", From dc1804930853da73e96a56a7c20204ae2104959a Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Mon, 8 Jan 2024 10:43:40 -0500 Subject: [PATCH 11/15] 0.8.14 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d11450e..d27902c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rokucommunity/bslint", - "version": "0.8.13", + "version": "0.8.14", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@rokucommunity/bslint", - "version": "0.8.13", + "version": "0.8.14", "license": "MIT", "dependencies": { "fs-extra": "^10.0.0", diff --git a/package.json b/package.json index b8db88e..0e674ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rokucommunity/bslint", - "version": "0.8.13", + "version": "0.8.14", "description": "BrighterScript linter plugin", "main": "dist/index.js", "bin": { From e7dfa4f0c0523c30df9534e88e09f7220890a7c5 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Tue, 16 Jan 2024 21:39:49 -0500 Subject: [PATCH 12/15] Update changelog for v0.8.15 --- CHANGELOG.md | 8 ++++++++ package-lock.json | 14 +++++++------- package.json | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ad5185..ecc692a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +## [0.8.15](https://github.com/rokucommunity/bslint/compare/v0.8.14...v0.8.15) - 2024-01-16 +### Changed + - upgrade to [brighterscript@0.65.17](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#06517---2024-01-16). Notable changes since 0.65.16: + - adds support for libpkg prefix ([brighterscript#1017](https://github.com/rokucommunity/brighterscript/pull/1017)) + - Assign .program to the builder BEFORE calling afterProgram ([brighterscript#1011](https://github.com/rokucommunity/brighterscript/pull/1011)) + + + ## [0.8.14](https://github.com/rokucommunity/bslint/compare/v0.8.13...v0.8.14) - 2024-01-08 ### Changed - upgrade to [brighterscript@0.65.16](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#06516---2024-01-08). Notable changes since 0.65.12: diff --git a/package-lock.json b/package-lock.json index d27902c..a142fcc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "@types/node": "^14.6.0", "@typescript-eslint/eslint-plugin": "^3.10.1", "@typescript-eslint/parser": "^3.10.1", - "brighterscript": "^0.65.16", + "brighterscript": "^0.65.17", "chai": "^4.3.6", "coveralls": "^3.1.1", "eslint": "^7.7.0", @@ -1025,9 +1025,9 @@ } }, "node_modules/brighterscript": { - "version": "0.65.16", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.16.tgz", - "integrity": "sha512-2RJMF8itkrPXtZ92JkJf3emvzcCl5ETXGVyPsdO/hMKbUGinEGMRFG07FR0bzjRotbALzsozGE/Hjzw412Sjww==", + "version": "0.65.17", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.17.tgz", + "integrity": "sha512-c86jJYXwInV5ETnuE13VgyT8i+cTimabUPknImF51LQ1/gUDdrPL8d7NKcx+K8QBZLCW1ozkj/k6qttfEQnZRw==", "dev": true, "dependencies": { "@rokucommunity/bslib": "^0.1.1", @@ -5807,9 +5807,9 @@ } }, "brighterscript": { - "version": "0.65.16", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.16.tgz", - "integrity": "sha512-2RJMF8itkrPXtZ92JkJf3emvzcCl5ETXGVyPsdO/hMKbUGinEGMRFG07FR0bzjRotbALzsozGE/Hjzw412Sjww==", + "version": "0.65.17", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.17.tgz", + "integrity": "sha512-c86jJYXwInV5ETnuE13VgyT8i+cTimabUPknImF51LQ1/gUDdrPL8d7NKcx+K8QBZLCW1ozkj/k6qttfEQnZRw==", "dev": true, "requires": { "@rokucommunity/bslib": "^0.1.1", diff --git a/package.json b/package.json index 0e674ab..1f2c6c9 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@types/node": "^14.6.0", "@typescript-eslint/eslint-plugin": "^3.10.1", "@typescript-eslint/parser": "^3.10.1", - "brighterscript": "^0.65.16", + "brighterscript": "^0.65.17", "chai": "^4.3.6", "coveralls": "^3.1.1", "eslint": "^7.7.0", From 8e720d2aace4ac99215261b24ce2a7a0d56babcc Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Tue, 16 Jan 2024 21:40:01 -0500 Subject: [PATCH 13/15] 0.8.15 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a142fcc..7ac8a41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rokucommunity/bslint", - "version": "0.8.14", + "version": "0.8.15", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@rokucommunity/bslint", - "version": "0.8.14", + "version": "0.8.15", "license": "MIT", "dependencies": { "fs-extra": "^10.0.0", diff --git a/package.json b/package.json index 1f2c6c9..2b70173 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rokucommunity/bslint", - "version": "0.8.14", + "version": "0.8.15", "description": "BrighterScript linter plugin", "main": "dist/index.js", "bin": { From 016e7edff517ab4b057b265a5d1993600143eff0 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Thu, 25 Jan 2024 14:51:29 -0500 Subject: [PATCH 14/15] Update changelog for v0.8.16 --- CHANGELOG.md | 8 ++++++++ package-lock.json | 14 +++++++------- package.json | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ecc692a..fa87a59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +## [0.8.16](https://github.com/rokucommunity/bslint/compare/v0.8.15...v0.8.16) - 2024-01-25 +### Changed + - upgrade to [brighterscript@0.65.18](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#06518---2024-01-25). Notable changes since 0.65.17: + - Prevent overwriting the Program._manifest if already set on startup ([brighterscript#1027](https://github.com/rokucommunity/brighterscript/pull/1027)) + - Improving null safety: Add FinalizedBsConfig and tweak plugin events ([brighterscript#1000](https://github.com/rokucommunity/brighterscript/pull/1000)) + + + ## [0.8.15](https://github.com/rokucommunity/bslint/compare/v0.8.14...v0.8.15) - 2024-01-16 ### Changed - upgrade to [brighterscript@0.65.17](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#06517---2024-01-16). Notable changes since 0.65.16: diff --git a/package-lock.json b/package-lock.json index 7ac8a41..c53a08b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "@types/node": "^14.6.0", "@typescript-eslint/eslint-plugin": "^3.10.1", "@typescript-eslint/parser": "^3.10.1", - "brighterscript": "^0.65.17", + "brighterscript": "^0.65.18", "chai": "^4.3.6", "coveralls": "^3.1.1", "eslint": "^7.7.0", @@ -1025,9 +1025,9 @@ } }, "node_modules/brighterscript": { - "version": "0.65.17", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.17.tgz", - "integrity": "sha512-c86jJYXwInV5ETnuE13VgyT8i+cTimabUPknImF51LQ1/gUDdrPL8d7NKcx+K8QBZLCW1ozkj/k6qttfEQnZRw==", + "version": "0.65.18", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.18.tgz", + "integrity": "sha512-6RU9gE1wYMS8thQCBuUcwrGeDo8ywnMp7DKzS/Zl5yHqvU9LstBP6Z3vFxDFxxovYGhIy5o1B6OulnxPBD0pVA==", "dev": true, "dependencies": { "@rokucommunity/bslib": "^0.1.1", @@ -5807,9 +5807,9 @@ } }, "brighterscript": { - "version": "0.65.17", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.17.tgz", - "integrity": "sha512-c86jJYXwInV5ETnuE13VgyT8i+cTimabUPknImF51LQ1/gUDdrPL8d7NKcx+K8QBZLCW1ozkj/k6qttfEQnZRw==", + "version": "0.65.18", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.18.tgz", + "integrity": "sha512-6RU9gE1wYMS8thQCBuUcwrGeDo8ywnMp7DKzS/Zl5yHqvU9LstBP6Z3vFxDFxxovYGhIy5o1B6OulnxPBD0pVA==", "dev": true, "requires": { "@rokucommunity/bslib": "^0.1.1", diff --git a/package.json b/package.json index 2b70173..213a461 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@types/node": "^14.6.0", "@typescript-eslint/eslint-plugin": "^3.10.1", "@typescript-eslint/parser": "^3.10.1", - "brighterscript": "^0.65.17", + "brighterscript": "^0.65.18", "chai": "^4.3.6", "coveralls": "^3.1.1", "eslint": "^7.7.0", From 5c5948365b958662bc3898da44878bd1ec60e228 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Thu, 25 Jan 2024 14:51:43 -0500 Subject: [PATCH 15/15] 0.8.16 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c53a08b..dd7082e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rokucommunity/bslint", - "version": "0.8.15", + "version": "0.8.16", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@rokucommunity/bslint", - "version": "0.8.15", + "version": "0.8.16", "license": "MIT", "dependencies": { "fs-extra": "^10.0.0", diff --git a/package.json b/package.json index 213a461..ada99b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rokucommunity/bslint", - "version": "0.8.15", + "version": "0.8.16", "description": "BrighterScript linter plugin", "main": "dist/index.js", "bin": {