Skip to content

Commit

Permalink
fix: --fix by default outside CI (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 authored Mar 14, 2024
1 parent 6d03340 commit 19c1373
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Binary file modified bun.lockb
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
},
"dependencies": {
"@antfu/utils": "^0.7.7",
"citty": "^0.1.6"
"citty": "^0.1.6",
"ci-info": "^4.0.0"
},
"devDependencies": {
"@types/bun": "latest",
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import { p } from "@antfu/utils";
import { bold, cyan, debug, dim, humanMs, isDebug, red, yellow } from "./utils";
import { createTaskList } from "./tasklist";
import { relative, resolve, sep } from "node:path";
import { isCI } from "ci-info";

export type * from "./types";

export async function check(options: CheckOptions = {}) {
const { debug, fix, root } = options;
const { debug, fix = !isCI, root } = options;
if (debug) {
process.env.DEBUG = "true";
}
Expand Down
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export interface CheckOptions {
/**
* Set to true to fix problems that can be automatically fixed.
*
* Defaults to `true` outside CI, and `false` inside CI.
*/
fix?: boolean;
/**
Expand Down

0 comments on commit 19c1373

Please sign in to comment.