Change Prettier settings (#36)

## Summary

I know this is a little tedious but I'd prefer to use the same settings
as in Ruff.
This commit is contained in:
Charlie Marsh
2024-09-05 08:06:45 -04:00
committed by GitHub
parent 1785c7bde0
commit 182c9c7e92
32 changed files with 5536 additions and 5497 deletions

View File

@ -1,49 +1,52 @@
import * as cache from '@actions/cache'
import * as core from '@actions/core'
import * as exec from '@actions/exec'
import {STATE_CACHE_MATCHED_KEY, STATE_CACHE_KEY} from './cache/restore-cache'
import {cacheLocalPath, enableCache} from './utils/inputs'
import * as cache from "@actions/cache";
import * as core from "@actions/core";
import * as exec from "@actions/exec";
import {
STATE_CACHE_MATCHED_KEY,
STATE_CACHE_KEY,
} from "./cache/restore-cache";
import { cacheLocalPath, enableCache } from "./utils/inputs";
export async function run(): Promise<void> {
try {
if (enableCache) {
await saveCache()
await saveCache();
}
} catch (error) {
const err = error as Error
core.setFailed(err.message)
const err = error as Error;
core.setFailed(err.message);
}
process.exit(0)
process.exit(0);
}
async function saveCache(): Promise<void> {
const cacheKey = core.getState(STATE_CACHE_KEY)
const matchedKey = core.getState(STATE_CACHE_MATCHED_KEY)
const cacheKey = core.getState(STATE_CACHE_KEY);
const matchedKey = core.getState(STATE_CACHE_MATCHED_KEY);
if (!cacheKey) {
core.warning('Error retrieving cache key from state.')
return
core.warning("Error retrieving cache key from state.");
return;
} else if (matchedKey === cacheKey) {
core.info(`Cache hit occurred on key ${cacheKey}, not saving cache.`)
return
core.info(`Cache hit occurred on key ${cacheKey}, not saving cache.`);
return;
}
await pruneCache()
await pruneCache();
core.info(`Saving cache path: ${cacheLocalPath}`)
await cache.saveCache([cacheLocalPath], cacheKey)
core.info(`Saving cache path: ${cacheLocalPath}`);
await cache.saveCache([cacheLocalPath], cacheKey);
core.info(`cache saved with the key: ${cacheKey}`)
core.info(`cache saved with the key: ${cacheKey}`);
}
async function pruneCache(): Promise<void> {
const options: exec.ExecOptions = {
silent: !core.isDebug()
}
const execArgs = ['cache', 'prune', '--ci']
silent: !core.isDebug(),
};
const execArgs = ["cache", "prune", "--ci"];
core.info('Pruning cache...')
await exec.exec('uv', execArgs, options)
core.info("Pruning cache...");
await exec.exec("uv", execArgs, options);
}
run()
run();