Skip to content

Commit

Permalink
lint & yarn fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jtbandes committed Nov 18, 2023
1 parent fb90670 commit 8fdfa66
Show file tree
Hide file tree
Showing 18 changed files with 89 additions and 88 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ jobs:
- uses: actions/checkout@v3
with:
lfs: true
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn
- run: corepack enable && yarn install --immutable
- run: yarn install --immutable
- run: echo '::add-matcher::.github/cspell-problem-matcher.json'
- run: yarn spellcheck --no-progress

Expand All @@ -28,11 +29,12 @@ jobs:
- uses: actions/checkout@v3
with:
lfs: true
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn
- run: corepack enable && yarn install --immutable
- run: yarn install --immutable
- run: yarn workspace @foxglove/mcap-conformance lint:ci
- run: yarn workspace @foxglove/mcap-conformance build

Expand All @@ -42,6 +44,7 @@ jobs:
- uses: actions/checkout@v3
with:
lfs: true
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20.x
Expand All @@ -51,7 +54,7 @@ jobs:
path: ~/.conan/data
key: ${{ runner.os }}-${{ hashFiles('cpp/**/conanfile.py') }}
- run: cd cpp && make ci
- run: corepack enable && yarn install --immutable
- run: yarn install --immutable
- run: yarn test:conformance:generate-inputs --verify
- run: yarn test:conformance --runner cpp-

Expand All @@ -61,6 +64,7 @@ jobs:
- uses: actions/checkout@v3
with:
lfs: true
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20.x
Expand All @@ -69,7 +73,7 @@ jobs:
with:
go-version-file: go/go.work
- run: cd go && make build-conformance-binaries
- run: corepack enable && yarn install --immutable
- run: yarn install --immutable
- run: yarn test:conformance:generate-inputs --verify
- run: yarn test:conformance --runner go-

Expand All @@ -79,6 +83,7 @@ jobs:
- uses: actions/checkout@v3
with:
lfs: true
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20.x
Expand All @@ -87,7 +92,7 @@ jobs:
with:
python-version: 3.7
- run: cd python && pip install -e mcap
- run: corepack enable && yarn install --immutable
- run: yarn install --immutable
- run: yarn test:conformance:generate-inputs --verify
- run: yarn test:conformance --runner py-

Expand All @@ -97,11 +102,12 @@ jobs:
- uses: actions/checkout@v3
with:
lfs: true
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn
- run: corepack enable && yarn install --immutable
- run: yarn install --immutable
- run: yarn test:conformance:generate-inputs --verify
- run: yarn test:conformance --runner ts-

Expand All @@ -111,11 +117,12 @@ jobs:
- uses: actions/checkout@v3
with:
lfs: true
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn
- run: corepack enable && yarn install --immutable
- run: yarn install --immutable
- run: yarn test:conformance:generate-inputs --verify
- run: yarn test:conformance --runner ksy-

Expand All @@ -125,6 +132,7 @@ jobs:
- uses: actions/checkout@v3
with:
lfs: true
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20.x
Expand All @@ -133,7 +141,7 @@ jobs:
with:
swift-version: "5.7"
- run: swift build
- run: corepack enable && yarn install --immutable
- run: yarn install --immutable
- run: yarn test:conformance:generate-inputs --verify
- run: yarn test:conformance --runner swift-

Expand All @@ -143,6 +151,7 @@ jobs:
- uses: actions/checkout@v3
with:
lfs: true
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20.x
Expand All @@ -152,7 +161,7 @@ jobs:
toolchain: stable
default: true
- run: cd rust && cargo build --example=conformance_reader
- run: corepack enable && yarn install --immutable
- run: yarn install --immutable
- run: yarn test:conformance:generate-inputs --verify
- run: yarn test:conformance --runner rust-

Expand Down Expand Up @@ -201,12 +210,13 @@ jobs:
- uses: actions/checkout@v3
with:
lfs: true
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn
registry-url: https://registry.npmjs.org
- run: corepack enable && yarn install --immutable
- run: yarn install --immutable
- run: yarn dedupe --check
- run: yarn prettier:check
- run: yarn workspace @mcap/core lint:ci
Expand Down Expand Up @@ -250,11 +260,12 @@ jobs:
- uses: actions/checkout@v3
with:
lfs: true
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn
- run: corepack enable && yarn install --immutable
- run: yarn install --immutable
- run: yarn workspace @foxglove/mcap-benchmarks lint:ci
- run: yarn workspace @foxglove/mcap-benchmarks typecheck
- run: yarn workspace @foxglove/mcap-example-validate lint:ci
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ jobs:
with:
lfs: true

- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn

- run: corepack enable && yarn install --immutable
- run: yarn install --immutable

- run: yarn workspace website lint:ci
- run: yarn workspace website typecheck
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// -*- jsonc -*-
{
"editor.codeActionsOnSave": { "source.fixAll.eslint": true },
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",

Expand Down
2 changes: 1 addition & 1 deletion tests/conformance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"colors": "1.4.0",
"commander": "11.1.0",
"diff": "^5.1.0",
"eslint": "8.53.0",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-es": "4.1.0",
"eslint-plugin-filenames": "1.3.2",
Expand Down
2 changes: 1 addition & 1 deletion typescript/benchmarks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@typescript-eslint/eslint-plugin": "6.11.0",
"@typescript-eslint/parser": "6.11.0",
"benny": "^3.7.1",
"eslint": "8.53.0",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-es": "4.1.0",
"eslint-plugin-filenames": "1.3.2",
Expand Down
6 changes: 3 additions & 3 deletions typescript/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"@types/jest": "29.5.8",
"@typescript-eslint/eslint-plugin": "6.11.0",
"@typescript-eslint/parser": "6.11.0",
"eslint": "8.53.0",
"eslint-config-prettier": "8.6.0",
"eslint-import-resolver-typescript": "3.5.5",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-es": "4.1.0",
"eslint-plugin-filenames": "1.3.2",
"eslint-plugin-import": "2.29.0",
Expand Down
2 changes: 1 addition & 1 deletion typescript/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@types/node": "18.13.0",
"@typescript-eslint/eslint-plugin": "6.11.0",
"@typescript-eslint/parser": "6.11.0",
"eslint": "8.53.0",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-es": "4.1.0",
"eslint-plugin-filenames": "1.3.2",
Expand Down
2 changes: 1 addition & 1 deletion typescript/examples/bag2mcap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@typescript-eslint/eslint-plugin": "6.11.0",
"@typescript-eslint/parser": "6.11.0",
"commander": "11.1.0",
"eslint": "8.53.0",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-es": "4.1.0",
"eslint-plugin-filenames": "1.3.2",
Expand Down
2 changes: 1 addition & 1 deletion typescript/examples/basicwriter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@mcap/nodejs": "workspace:*",
"@mcap/support": "workspace:*",
"@types/node": "18.13.0",
"eslint": "8.53.0",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-es": "4.1.0",
"eslint-plugin-filenames": "1.3.2",
Expand Down
2 changes: 1 addition & 1 deletion typescript/examples/flatbufferswriter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@mcap/core": "workspace:*",
"@mcap/nodejs": "workspace:*",
"@types/node": "18.13.0",
"eslint": "8.53.0",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-es": "4.1.0",
"eslint-plugin-filenames": "1.3.2",
Expand Down
2 changes: 1 addition & 1 deletion typescript/examples/text-annotation-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@mcap/core": "workspace:*",
"@mcap/nodejs": "workspace:*",
"@types/node": "18.13.0",
"eslint": "8.53.0",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-es": "4.1.0",
"eslint-plugin-filenames": "1.3.2",
Expand Down
2 changes: 1 addition & 1 deletion typescript/examples/validate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@typescript-eslint/eslint-plugin": "6.11.0",
"@typescript-eslint/parser": "6.11.0",
"commander": "11.1.0",
"eslint": "8.53.0",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-es": "4.1.0",
"eslint-plugin-filenames": "1.3.2",
Expand Down
6 changes: 3 additions & 3 deletions typescript/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"@types/node": "18.13.0",
"@typescript-eslint/eslint-plugin": "6.11.0",
"@typescript-eslint/parser": "6.11.0",
"eslint": "8.53.0",
"eslint-config-prettier": "8.6.0",
"eslint-import-resolver-typescript": "3.5.5",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-es": "4.1.0",
"eslint-plugin-filenames": "1.3.2",
"eslint-plugin-import": "2.29.0",
Expand Down
16 changes: 8 additions & 8 deletions typescript/nodejs/src/FileHandleReadable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ import { FileHandle } from "fs/promises";
* IReadable implementation for FileHandle.
*/
export class FileHandleReadable implements McapTypes.IReadable {
private handle: FileHandle;
private buffer = new ArrayBuffer(4096);
#handle: FileHandle;
#buffer = new ArrayBuffer(4096);

constructor(handle: FileHandle) {
this.handle = handle;
this.#handle = handle;
}

async size(): Promise<bigint> {
return BigInt((await this.handle.stat()).size);
return BigInt((await this.#handle.stat()).size);
}

async read(offset: bigint, length: bigint): Promise<Uint8Array> {
if (offset > Number.MAX_SAFE_INTEGER || length > Number.MAX_SAFE_INTEGER) {
throw new Error(`Read too large: offset ${offset}, length ${length}`);
}
if (length > this.buffer.byteLength) {
this.buffer = new ArrayBuffer(Number(length * 2n));
if (length > this.#buffer.byteLength) {
this.#buffer = new ArrayBuffer(Number(length * 2n));
}
const result = await this.handle.read({
buffer: new DataView(this.buffer, 0, Number(length)),
const result = await this.#handle.read({
buffer: new DataView(this.#buffer, 0, Number(length)),
position: Number(offset),
});
if (result.bytesRead !== Number(length)) {
Expand Down
12 changes: 6 additions & 6 deletions typescript/nodejs/src/FileHandleWritable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import { FileHandle } from "fs/promises";
* IWritable implementation for FileHandle.
*/
export class FileHandleWritable implements IWritable {
private handle: FileHandle;
private totalBytesWritten = 0;
#handle: FileHandle;
#totalBytesWritten = 0;

constructor(handle: FileHandle) {
this.handle = handle;
this.#handle = handle;
}

async write(buffer: Uint8Array): Promise<void> {
const written = await this.handle.write(buffer);
this.totalBytesWritten += written.bytesWritten;
const written = await this.#handle.write(buffer);
this.#totalBytesWritten += written.bytesWritten;
}

position(): bigint {
return BigInt(this.totalBytesWritten);
return BigInt(this.#totalBytesWritten);
}
}
4 changes: 2 additions & 2 deletions typescript/support/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"@types/node": "18.13.0",
"@typescript-eslint/eslint-plugin": "6.11.0",
"@typescript-eslint/parser": "6.11.0",
"eslint": "8.53.0",
"eslint-config-prettier": "8.6.0",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-es": "4.1.0",
"eslint-plugin-filenames": "1.3.2",
"eslint-plugin-import": "2.29.0",
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@types/promise-queue": "2.2.0",
"buffer": "6.0.3",
"classnames": "2.3.2",
"eslint": "8.53.0",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-es": "4.1.0",
"eslint-plugin-filenames": "1.3.2",
Expand Down
Loading

0 comments on commit 8fdfa66

Please sign in to comment.