From 981cd4fc2e5e57f61b63c632a61e4162ea12d272 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Sun, 13 Nov 2022 20:29:05 -0600 Subject: [PATCH] style: Set bracketSpacing to true --- .eslintrc.json | 4 ++-- .prettierrc.json | 2 +- src/functions.ts | 6 +++--- src/main.ts | 6 +++--- test/functions.ts | 11 +++++++---- test/releasedata.ts | 13 ++++++++----- 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 4e62d65..d64324a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -15,7 +15,7 @@ "@typescript-eslint/no-unused-vars": "error", "@typescript-eslint/explicit-member-accessibility": [ "error", - {"accessibility": "no-public"} + { "accessibility": "no-public" } ], "@typescript-eslint/no-require-imports": "error", "@typescript-eslint/array-type": "error", @@ -25,7 +25,7 @@ "@typescript-eslint/consistent-type-assertions": "error", "@typescript-eslint/explicit-function-return-type": [ "error", - {"allowExpressions": true} + { "allowExpressions": true } ], "@typescript-eslint/func-call-spacing": ["error", "never"], "@typescript-eslint/no-array-constructor": "error", diff --git a/.prettierrc.json b/.prettierrc.json index c34bafc..05d3af9 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -5,6 +5,6 @@ "semi": false, "singleQuote": true, "trailingComma": "none", - "bracketSpacing": false, + "bracketSpacing": true, "arrowParens": "avoid" } diff --git a/src/functions.ts b/src/functions.ts index fc5e803..f26b322 100644 --- a/src/functions.ts +++ b/src/functions.ts @@ -1,11 +1,11 @@ import * as core from '@actions/core' import * as fs from 'fs' import * as tc from '@actions/tool-cache' -import {GitHub} from '@actions/github/lib/utils' +import { GitHub } from '@actions/github/lib/utils' import retry from 'async-retry' import semver from 'semver' -const NEXTFLOW_REPO = {owner: 'nextflow-io', repo: 'nextflow'} +const NEXTFLOW_REPO = { owner: 'nextflow-io', repo: 'nextflow' } // HACK Private but I want to test this export async function all_nf_releases( @@ -22,7 +22,7 @@ export async function all_nf_releases( export async function latest_stable_release_data( ok: InstanceType ): Promise { - const {data: stable_release} = await ok.rest.repos.getLatestRelease( + const { data: stable_release } = await ok.rest.repos.getLatestRelease( NEXTFLOW_REPO ) diff --git a/src/main.ts b/src/main.ts index c337fdc..f143529 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,9 +2,9 @@ import * as core from '@actions/core' import * as exec from '@actions/exec' import * as fs from 'fs' import * as github from '@actions/github' -import {GitHub} from '@actions/github/lib/utils' +import { GitHub } from '@actions/github/lib/utils' import * as tc from '@actions/tool-cache' -import {install_nextflow, nextflow_bin_url, release_data} from './functions' +import { install_nextflow, nextflow_bin_url, release_data } from './functions' async function run(): Promise { // Set environment variables @@ -69,7 +69,7 @@ async function run(): Promise { nf_path = await tc.cacheDir(nf_install_path, 'nextflow', resolved_version) core.debug(`Added Nextflow to cache: ${nf_path}`) - fs.rmdirSync(nf_install_path, {recursive: true}) + fs.rmdirSync(nf_install_path, { recursive: true }) } else { core.debug(`Using cached version of Nextflow: ${nf_path}`) } diff --git a/test/functions.ts b/test/functions.ts index c0da4ff..59fe481 100644 --- a/test/functions.ts +++ b/test/functions.ts @@ -1,8 +1,8 @@ import * as functions from '../src/functions' -import {getToken} from './utils' +import { getToken } from './utils' import * as github from '@actions/github' -import {GitHub} from '@actions/github/lib/utils' -import anyTest, {TestFn} from 'ava' // eslint-disable-line import/no-unresolved +import { GitHub } from '@actions/github/lib/utils' +import anyTest, { TestFn } from 'ava' // eslint-disable-line import/no-unresolved const test = anyTest as TestFn<{ token: string @@ -12,7 +12,10 @@ const test = anyTest as TestFn<{ test.before(t => { const first = true const current_token = getToken(first) - t.context = {token: current_token, octokit: github.getOctokit(current_token)} + t.context = { + token: current_token, + octokit: github.getOctokit(current_token) + } }) test('all_nf_releases', async t => { diff --git a/test/releasedata.ts b/test/releasedata.ts index 10e0a28..8dbd523 100644 --- a/test/releasedata.ts +++ b/test/releasedata.ts @@ -1,8 +1,8 @@ import * as github from '@actions/github' -import {release_data} from '../src/functions' -import {getToken} from './utils' -import {GitHub} from '@actions/github/lib/utils' -import anyTest, {TestFn} from 'ava' // eslint-disable-line import/no-unresolved +import { release_data } from '../src/functions' +import { getToken } from './utils' +import { GitHub } from '@actions/github/lib/utils' +import anyTest, { TestFn } from 'ava' // eslint-disable-line import/no-unresolved const test = anyTest as TestFn<{ token: string @@ -12,7 +12,10 @@ const test = anyTest as TestFn<{ test.before(t => { const first = true const current_token = getToken(first) - t.context = {token: current_token, octokit: github.getOctokit(current_token)} + t.context = { + token: current_token, + octokit: github.getOctokit(current_token) + } }) const macro = test.macro(async (t, version: string, expected: string) => {