Skip to content

Commit

Permalink
Merge branch 'main' into don/09-20-refactor_macros_clean_up_declare_o…
Browse files Browse the repository at this point in the history
…xc_secret
  • Loading branch information
DonIsaac authored Oct 16, 2024
2 parents 3015a91 + 9f555d7 commit 652e8b8
Show file tree
Hide file tree
Showing 742 changed files with 48,374 additions and 30,860 deletions.
45 changes: 45 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
{
"name": "Rust",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/rust:latest",
"features": {
// add `just` for running scripts
"ghcr.io/guiyomh/features/just:0": {
"version": "latest"
},
// add `cargo-binstall` for installing other tools.
"ghcr.io/lee-orr/rusty-dev-containers/cargo-binstall:0": {
"version": "latest"
}
},
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer"
]
}
},

// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
// "mounts": [
// {
// "source": "devcontainer-cargo-cache-${devcontainerId}",
// "target": "/usr/local/cargo",
// "type": "volume"
// }
// ]

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "just init"
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
1 change: 1 addition & 0 deletions .github/.generated_ast_watch_list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ src:
- 'crates/oxc_ast/src/ast/js.rs'
- 'crates/oxc_ast/src/ast/ts.rs'
- 'crates/oxc_ast/src/ast/jsx.rs'
- 'crates/oxc_ast/src/ast/comment.rs'
- 'crates/oxc_syntax/src/number.rs'
- 'crates/oxc_syntax/src/operator.rs'
- 'crates/oxc_span/src/span/types.rs'
Expand Down
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ about: Create a report to help us improve.
title: ''
labels: C-bug
---

<!--
!!IMPORTANT!! If you are reporting a bug for Oxlint or the Oxc VSCode extension,
please use the "Linter bug report" template instead. You can find it here:
https://github.com/oxc-project/oxc/issues/new?assignees=DonIsaac&labels=C-bug,A-linter&projects=&template=linter_bug_report.yaml&title=linter:+
-->
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/linter_bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Linter bug report
description: Report a bug in Oxlint
title: "linter: "
labels: ["C-bug", "A-linter"]
assignees:
- DonIsaac

body:
- type: markdown
attributes:
value: |
Thanks for helping us improve Oxlint! Please fill out the sections below to help us understand and reproduce the issue you're experiencing.
- type: input
id: version
attributes:
label: What version of Oxlint are you using?
description: You can find the version by running `oxlint -V`. If you ran Oxlint using `npx`, use 'latest'. If you're not sure, please say 'not sure'.
placeholder: 0.9.8

- type: input
id: command
attributes:
label: What command did you run?
description: Please include the full command with all arguments. If you're not certain (e.g. you're using the VSCode extension), please provide as much detail as possible.

- type: textarea
id: config
attributes:
label: What does your `.oxlint.json` config file look like?
description: If you're not using a config file, please say so. Otherwise paste please paste its contents here.

- type: textarea
id: what-happened
attributes:
label: What happened?
description: Please describe the issue you're experiencing.
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ A-cli:
- changed-files:
- any-glob-to-any-file: ["apps/oxlint/**"]

A-editor:
- changed-files:
- any-glob-to-any-file: ["crates/oxc_language_server/**", "editors/**"]

A-prettier:
- changed-files:
- any-glob-to-any-file: ["crates/oxc_prettier/**", "tasks/prettier_conformance/**"]
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,19 @@ jobs:
restore-cache: false
tools: just,cargo-shear@1,dprint
components: rustfmt
- name: Restore dprint plugin cache
id: cache-restore
uses: actions/cache/restore@v4
with:
key: dprint-autofix-ci-${{ runner.os }}-${{ hashFiles('dprint.json') }}
path: ~/.cache/dprint
- run: just fmt
- uses: autofix-ci/action@v1.3.1
with:
fail-fast: false
- name: Save dprint plugin cache
id: cache-save
uses: actions/cache/save@v4
with:
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
path: ~/.cache/dprint
13 changes: 10 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ on:
types: [opened, synchronize]
paths:
- "**/*.rs"
- "!apps/**"
- "!tasks/website/**"
- "!tasks/ast_tools/**"
- "!tasks/coverage/**"
- "!crates/oxc_language_server/**"
- "napi/parser/**/*.js"
- "napi/parser/**/*.mjs"
- "Cargo.lock"
Expand All @@ -30,6 +35,11 @@ on:
- main
paths:
- "**/*.rs"
- "!apps/**"
- "!tasks/website/**"
- "!tasks/ast_tools/**"
- "!tasks/coverage/**"
- "!crates/oxc_language_server/**"
- "napi/parser/**/*.js"
- "napi/parser/**/*.mjs"
- "Cargo.lock"
Expand Down Expand Up @@ -123,9 +133,6 @@ jobs:
cache-key: benchmark-linter
save-cache: ${{ github.ref_name == 'main' }}

- uses: mozilla-actions/sccache-action@v0.0.5
if: ${{ vars.USE_SCCACHE == 'true' }}

- name: Build benchmark
env:
RUSTFLAGS: "-C debuginfo=1 -C strip=none -g --cfg codspeed"
Expand Down
31 changes: 22 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
- run: git diff --exit-code # Must commit everything

test-windows:
if: false
name: Test (windows-latest)
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -142,7 +143,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@v1
- uses: crate-ci/typos@v1.24.5
- uses: crate-ci/typos@v1.26.0
with:
files: .

Expand Down Expand Up @@ -177,7 +178,16 @@ jobs:
with:
cache-key: warm
components: clippy
tools: ast-grep
- run: cargo lint -- -D warnings
- name: Check Char and Byte Offset
run: |
output=$(sg -p '$A.chars().enumerate()' -r '$A.char_indices()' -l rs)
echo "Output: $output"
if [ -n "$output" ]; then
echo "Error: Unexpected output detected"
exit 1
fi
doc:
name: Doc
Expand All @@ -201,9 +211,18 @@ jobs:
with:
filters: |
src:
- '!.github/**'
- '!.vscode/**'
- '!apps/**'
- '!editors/**'
- '!napi/**'
- '!npm/**'
- '!wasm/**'
- '!crates/oxc_linter/**'
- '!crates/oxc_wasm/**'
- '!crates/oxc_language_server/**'
- '!tasks/**'
- 'tasks/conformance/**'
- uses: ./.github/actions/clone-submodules
if: steps.filter.outputs.src == 'true'
Expand Down Expand Up @@ -273,13 +292,7 @@ jobs:
cache-key: warm
- uses: ./.github/actions/pnpm
if: steps.filter.outputs.src == 'true'
- name: Test napi/parser
run: pnpm build && pnpm test
if: steps.filter.outputs.src == 'true'
working-directory: napi/parser
- name: Test napi/transform
- run: pnpm run build
if: steps.filter.outputs.src == 'true'
working-directory: napi/transform
run: pnpm build && pnpm test
- run: git diff --exit-code
- run: pnpm run test
if: steps.filter.outputs.src == 'true'
12 changes: 9 additions & 3 deletions .github/workflows/miri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@ on:
pull_request:
types: [opened, synchronize]
paths:
- "crates/oxc_parser/**"
- "crates/oxc_allocator/**"
- "crates/oxc_data_structures/**"
- "crates/oxc_parser/**"
- "crates/oxc_traverse/**"
- ".github/workflows/miri.yml"
push:
branches:
- main
paths:
- "crates/oxc_parser/**"
- "crates/oxc_allocator/**"
- "crates/oxc_data_structures/**"
- "crates/oxc_parser/**"
- "crates/oxc_traverse/**"
- ".github/workflows/miri.yml"

concurrency:
Expand All @@ -40,4 +44,6 @@ jobs:
cargo miri setup
- name: Test with Miri
run: cargo miri test -p oxc_parser
run: |
cargo miri test -p oxc_parser
cargo miri test -p oxc_transformer
37 changes: 37 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- uses: actions/labeler@v5

- name: Validate PR title
id: pr-title
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -45,3 +46,39 @@ jobs:
revert
style
test
- name: Get category label from PR title
id: get-category
env:
PR_TYPE: ${{ steps.pr-title.outputs.type }}
run: |
case "$PR_TYPE" in
"feat")
CATEGORY="C-enhancement"
;;
"fix")
CATEGORY="C-bug"
;;
"test")
CATEGORY="C-test"
;;
"refactor" | "chore" | "style")
CATEGORY="C-cleanup"
;;
"docs")
CATEGORY="C-docs"
;;
"perf")
CATEGORY="C-performance"
;;
*)
CATEGORY=""
;;
esac
echo "CATEGORY=$CATEGORY" >> $GITHUB_OUTPUT
- name: Add category label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ steps.get-category.outputs.CATEGORY != '' }}
with:
labels: ${{ steps.get-category.outputs.CATEGORY }}
22 changes: 22 additions & 0 deletions .github/workflows/prepare_release_crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,25 @@ jobs:
name: crates
secrets:
OXC_BOT_PAT: ${{ secrets.OXC_BOT_PAT }}

ecosystem-ci:
needs: prepare
name: Trigger Monitor Oxc
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@v1

- uses: peter-evans/create-or-update-comment@v4
id: comment
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ needs.prepare.outputs.pull-request-number }}
body: Triggering Monitor Oxc https://github.com/oxc-project/monitor-oxc/actions/workflows/ci.yml

- uses: benc-uk/workflow-dispatch@v1
with:
repo: oxc-project/monitor-oxc
workflow: ci.yml
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "comment-id": "${{ steps.comment.outputs.comment-id }}" }'
7 changes: 4 additions & 3 deletions .github/workflows/release_napi_parser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,13 @@ jobs:
mv target/${{ matrix.target }}/release/*.@(so|dll|dylib) napi/parser/parser.${{ matrix.code-target }}.node
ls napi/parser
- uses: ./.github/actions/pnpm
if: ${{ contains(matrix.target, 'x86') && !contains(matrix.target, 'musl') }} # Need docker for aarch64

- name: Test
working-directory: napi/parser
if: ${{ contains(matrix.target, 'x86') && !contains(matrix.target, 'musl') }} # Need docker for aarch64
run: |
ls
node test.mjs
run: pnpm run test

# The binary is zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss
- name: Archive Binary
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release_napi_transform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,13 @@ jobs:
mv target/${{ matrix.target }}/release/*.@(so|dll|dylib) napi/transform/transform.${{ matrix.code-target }}.node
ls napi/transform
- uses: ./.github/actions/pnpm
if: ${{ contains(matrix.target, 'x86') && !contains(matrix.target, 'musl') }} # Need docker for aarch64

- name: Test
working-directory: napi/transform
if: ${{ contains(matrix.target, 'x86') && !contains(matrix.target, 'musl') }} # Need docker for aarch64
run: |
ls
node test.mjs
run: pnpm run test

# The binary is zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss
- name: Archive Binary
Expand Down
4 changes: 4 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ extend-exclude = [
"tasks/coverage/babel",
"tasks/coverage/test262",
"tasks/coverage/typescript",
"tasks/coverage/snapshots",
"tasks/prettier_conformance/prettier",
"tasks/prettier_conformance/snapshots",
"tasks/transform_conformance/tests/**/output.js",
"tasks/transform_conformance/snapshots",
]

[default]
Expand Down
Loading

0 comments on commit 652e8b8

Please sign in to comment.