add prettier config

This commit is contained in:
Ryan Cao 2023-07-19 10:43:43 +08:00
parent 5f106d5966
commit 16bd754a82
No known key found for this signature in database
7 changed files with 75 additions and 79 deletions

4
.prettierrc Normal file
View file

@ -0,0 +1,4 @@
{
"useTabs": true,
"printWidth": 120
}

View file

@ -11,7 +11,7 @@ export const install = async () => {
core.info("Installing attic"); core.info("Installing attic");
const installScript = await fetch( const installScript = await fetch(
"https://raw.githubusercontent.com/zhaofengli/attic/main/.github/install-attic-ci.sh" "https://raw.githubusercontent.com/zhaofengli/attic/main/.github/install-attic-ci.sh",
).then((r) => { ).then((r) => {
if (!r.ok) { if (!r.ok) {
core.setFailed(`Action failed with error: ${r.statusText}`); core.setFailed(`Action failed with error: ${r.statusText}`);

View file

@ -18,11 +18,7 @@ export const push = async () => {
const addedPaths = newPaths const addedPaths = newPaths
.filter((p) => !oldPaths.includes(p)) .filter((p) => !oldPaths.includes(p))
.filter( .filter(
(p) => (p) => !p.endsWith(".drv") && !p.endsWith(".drv.chroot") && !p.endsWith(".check") && !p.endsWith(".lock"),
!p.endsWith(".drv") &&
!p.endsWith(".drv.chroot") &&
!p.endsWith(".check") &&
!p.endsWith(".lock")
); );
await exec("attic", ["push", cache, ...addedPaths]); await exec("attic", ["push", cache, ...addedPaths]);

View file

@ -4,11 +4,7 @@ import { Writable } from "node:stream";
class StringStream extends Writable { class StringStream extends Writable {
chunks: Buffer[] = []; chunks: Buffer[] = [];
_write( _write(chunk: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>, _enc: unknown, next: () => unknown) {
chunk: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>,
_enc: unknown,
next: () => unknown
) {
this.chunks.push(Buffer.from(chunk)); this.chunks.push(Buffer.from(chunk));
next(); next();
} }