Skip to content

Commit

Permalink
chore: handle CARGO_TARGET_DIR in tools/linter (#1179)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmaSd authored Jul 21, 2023
1 parent 71edb29 commit 9f81fcd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Lint
if: contains(matrix.os, 'ubuntu')
run: deno run --allow-run ./tools/lint.ts --release
run: deno run --allow-run --allow-env ./tools/lint.ts --release

- name: Check if www/static/docs.json is up-to-date
if: contains(matrix.os, 'ubuntu')
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Before submitting, please make sure the following is done:
2. There are tests that cover the changes.
3. Ensure `cargo test` passes.
4. Format your code with `deno run --allow-run tools/format.ts`
5. Make sure `deno run --allow-run tools/lint.ts` passes.
5. Make sure `deno run --allow-run --allow-env tools/lint.ts` passes.
6. If you've added a new rule:
1. Run `cargo build --example dlint --all-features`
2. Update docs by running the generated binary with these arguments
Expand Down
5 changes: 4 additions & 1 deletion tools/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ if (o1.code !== 0) {

console.log("deno lint");

const dlint = `./target/${release ? "release" : "debug"}/examples/dlint`;
const cargoTargetDir = Deno.env.get("CARGO_TARGET_DIR") || "./target";
const dlint = `${cargoTargetDir}/${
release ? "release" : "debug"
}/examples/dlint`;
const p2 = new Deno.Command(dlint, {
args: ["run", "benchmarks/benchmarks.ts"],
stdin: "null",
Expand Down

0 comments on commit 9f81fcd

Please sign in to comment.