no-yan
07196ae0a8
perf(justfile): optimize submodule cloining with shallow fetch ( #6292 )
...
fix #6291 , where `just submodules` takes around 8 minutes to clone
repositories.
This change reduces the clone time from around 8 minutes to 42 seconds
in reported scenario.
<img width="534" alt="image"
src="https://github.com/user-attachments/assets/bf74e412-f1ed-419e-b180-09ed96a8eb67 ">
<details><summary>Command log: time just submodules</summary>
<p>
```
❯ time just submodules
just clone-submodule tasks/coverage/test262 git@github.com:tc39/test262.git d62fa93c8f9ce5e687c0bbaa5d2b59670ab2ff60
cd tasks/coverage/test262 || git init tasks/coverage/test262
bash: 1 行: cd: tasks/coverage/test262: No such file or directory
Initialized empty Git repository in /Users/noyan/ghq/github.com/oxc-project/oxc/tasks/coverage/test262/.git/
cd tasks/coverage/test262 && git remote add origin git@github.com:tc39/test262.git || true
cd tasks/coverage/test262 && git fetch --depth=1 origin d62fa93c8f9ce5e687c0bbaa5d2b59670ab2ff60 && git reset --hard d62fa93c8f9ce5e687c0bbaa5d2b59670ab2ff60
remote: Enumerating objects: 53504, done.
remote: Counting objects: 100% (53504/53504), done.
remote: Compressing objects: 100% (19436/19436), done.
remote: Total 53504 (delta 39436), reused 39428 (delta 33947), pack-reused 0 (from 0)
Receiving objects: 100% (53504/53504), 12.32 MiB | 9.06 MiB/s, done.
Resolving deltas: 100% (39436/39436), done.
From github.com:tc39/test262
* branch d62fa93c8f9ce5e687c0bbaa5d2b59670ab2ff60 -> FETCH_HEAD
Updating files: 100% (51664/51664), done.
HEAD is now at d62fa93c [explicit-resource-management] Complete exception handling
just clone-submodule tasks/coverage/babel git@github.com:babel/babel.git 3bcfee232506a4cebe410f02042fb0f0adeeb0b1
cd tasks/coverage/babel || git init tasks/coverage/babel
bash: 1 行: cd: tasks/coverage/babel: No such file or directory
Initialized empty Git repository in /Users/noyan/ghq/github.com/oxc-project/oxc/tasks/coverage/babel/.git/
cd tasks/coverage/babel && git remote add origin git@github.com:babel/babel.git || true
cd tasks/coverage/babel && git fetch --depth=1 origin 3bcfee232506a4cebe410f02042fb0f0adeeb0b1 && git reset --hard 3bcfee232506a4cebe410f02042fb0f0adeeb0b1
remote: Enumerating objects: 36357, done.
remote: Counting objects: 100% (36357/36357), done.
remote: Compressing objects: 100% (21830/21830), done.
remote: Total 36357 (delta 8527), reused 30780 (delta 7455), pack-reused 0 (from 0)
Receiving objects: 100% (36357/36357), 9.34 MiB | 9.24 MiB/s, done.
Resolving deltas: 100% (8527/8527), done.
From github.com:babel/babel
* branch 3bcfee232506a4cebe410f02042fb0f0adeeb0b1 -> FETCH_HEAD
Updating files: 100% (31735/31735), done.
HEAD is now at 3bcfee23 Fix printing of TS `infer` in compact mode (#16788 )
just clone-submodule tasks/coverage/typescript git@github.com:microsoft/TypeScript.git a709f9899c2a544b6de65a0f2623ecbbe1394eab
cd tasks/coverage/typescript || git init tasks/coverage/typescript
bash: 1 行: cd: tasks/coverage/typescript: No such file or directory
Initialized empty Git repository in /Users/noyan/ghq/github.com/oxc-project/oxc/tasks/coverage/typescript/.git/
cd tasks/coverage/typescript && git remote add origin git@github.com:microsoft/TypeScript.git || true
cd tasks/coverage/typescript && git fetch --depth=1 origin a709f9899c2a544b6de65a0f2623ecbbe1394eab && git reset --hard a709f9899c2a544b6de65a0f2623ecbbe1394eab
remote: Enumerating objects: 69880, done.
remote: Counting objects: 100% (69880/69880), done.
remote: Compressing objects: 100% (52067/52067), done.
remote: Total 69880 (delta 17267), reused 39053 (delta 16227), pack-reused 0 (from 0)
Receiving objects: 100% (69880/69880), 32.80 MiB | 8.54 MiB/s, done.
Resolving deltas: 100% (17267/17267), done.
From github.com:microsoft/TypeScript
* branch a709f9899c2a544b6de65a0f2623ecbbe1394eab -> FETCH_HEAD
Updating files: 100% (72575/72575), done.
HEAD is now at a709f9899 Update deps, dprint plugins (#59810 )
just clone-submodule tasks/prettier_conformance/prettier git@github.com:prettier/prettier.git 52829385bcc4d785e58ae2602c0b098a643523c9
cd tasks/prettier_conformance/prettier || git init tasks/prettier_conformance/prettier
bash: 1 行: cd: tasks/prettier_conformance/prettier: No such file or directory
Initialized empty Git repository in /Users/noyan/ghq/github.com/oxc-project/oxc/tasks/prettier_conformance/prettier/.git/
cd tasks/prettier_conformance/prettier && git remote add origin git@github.com:prettier/prettier.git || true
cd tasks/prettier_conformance/prettier && git fetch --depth=1 origin 52829385bcc4d785e58ae2602c0b098a643523c9 && git reset --hard 52829385bcc4d785e58ae2602c0b098a643523c9
remote: Enumerating objects: 10259, done.
remote: Counting objects: 100% (10259/10259), done.
remote: Compressing objects: 100% (6662/6662), done.
remote: Total 10259 (delta 970), reused 8226 (delta 696), pack-reused 0 (from 0)
Receiving objects: 100% (10259/10259), 12.85 MiB | 10.34 MiB/s, done.
Resolving deltas: 100% (970/970), done.
From github.com:prettier/prettier
* branch 52829385bcc4d785e58ae2602c0b098a643523c9 -> FETCH_HEAD
HEAD is now at 5282938 Release 3.3.3
just submodules 1.56s user 12.29s system 32% cpu 42.408 total
```
</p>
</details>
## Solution
To optimize the cloning process:
- Fetch only the specified commit, eliminating the need for a git clone
(which fetches HEAD and subsequently updates with differences).
- Initialize it with git init when the repository doesn't exist locally.
- Use `git fetch --depth=1` to prevent fetching previous commits.
See: https://stackoverflow.com/a/3489576
I initially suggested using `git fetch --depth=1`, but after testing, I
found that removing clone could speed up the process by about 20
seconds. Therefore, I've changed the approach.
2024-10-05 23:58:03 +08:00
Brandon Largeau
006f2cdbf9
fix(just): use powershell compatible env variable for doc command ( #6168 )
...
Hello,
I was following the guide
https://oxc.rs/docs/contribute/development.html and executed `just
ready` as said.
I got an error on Windows on the `doc` command because it sets the env
variable in a way that is not compatible with `powershell`.
I've used
[attributes](https://just.systems/man/en/attributes.html#attributes ) to
fix the issue.
I never used `just` so I don't know if there's a better way to fix the
issue.
2024-09-30 09:59:27 +08:00
DonIsaac
d24985ed51
feat(linter): add oxc-security/api-keys ( #5906 )
...
## What This PR does
Adds a new `oxc-security/api-key` rule that scans for hard-coded API keys.
It is broken up into "secret rules", where each one is responsible for finding a different kind of key. It is architecturally identical to how lint rules themselves. This PR also includes the first of these rules, for AWS access key IDs.
Logic and rules are based on [keyhunter](https://github.com/Donisaac/keyhunter ). I've licensed that repo under GNU GPLv3, but it's my code and I can do what I want with it 😈 (read: I'm fine with it being MIT for oxc).
This PR is a complete feature in its own right, but does not represent the end of this work. See https://github.com/oxc-project/backlog/issues/116 to track overall progress.
2024-09-22 22:39:56 +00:00
Boshen
612f638bcd
chore: change just c to run cargo conformance
2024-09-22 23:50:30 +08:00
Boshen
508cbeafd5
chore(justfile): add just watch-oxlint
2024-09-09 16:57:51 +08:00
Boshen
63a830e08c
chore(dprint): format toml files ( #5599 )
...
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2024-09-08 14:26:16 +08:00
Boshen
0571a37022
chore(justfile): add dprint to just init
2024-09-08 14:02:24 +08:00
Boshen
955e83ec41
ci: add dprint to autofix ( #5597 )
2024-09-08 13:46:30 +08:00
Boshen
d00a1f6511
chore: use dprint to format js, json and markdown
2024-09-08 13:24:58 +08:00
Boshen
2fb8c202e6
refactor(justfile): remove wasm-pack and cargo-llvm-cov from just init
...
They are rarely used.
2024-09-08 12:47:45 +08:00
IWANABETHATGUY
caf800700d
chore(justfile): bundle wasm with different flag ( #5433 )
...
1. wasm-pack with release flag will increase wasm bundling time, which
hurts dx when developing playground.
2. only enable `release` flag when `build-wasm`.
2024-09-04 13:30:48 +08:00
Boshen
cd0516752c
chore(justfile): build-wasm should build in prod
2024-09-04 08:58:14 +08:00
leaysgur
c7e61a1391
chore(prettier): Update conformance tests to Prettier v3.3.3 ( #5394 )
...
- v3.3.3 is latest released version
- Test file name was changed from v3.3.x
- https://github.com/prettier/prettier/pull/16244
2024-09-02 10:32:17 +00:00
Boshen
29f8497001
ci: autofix formatting relates jobs ( #5383 )
...
closes #5382
Autofixes toml, rust and unused dependencies.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-01 16:19:53 +08:00
Boshen
e75e0f1465
chore: update test262 / babel / typescript submodules ( #5369 )
...
closes #5215
2024-08-31 12:28:25 +00:00
Kevin Deng 三咲智子
ac8fabd442
chore: fix precommit install hook ( #5271 )
...
Add `-e` for enabling interpretation of backslash escapes.
Before:
```
#!/bin/sh\njust fmt
```
2024-08-28 09:04:29 +08:00
Boshen
4c88997727
comment just ast
2024-08-23 21:42:21 +08:00
Boshen
c220730779
feat(coverage): check symbols and scopes after transformation ( #4917 )
...
closes https://github.com/oxc-project/oxc/issues/4790
@overlookmotel enjoy ... take a look at the snapshots and probably nothing else.
The snapshots are minimal right now, but it's already showing symbols from import specifiers are not being removed. We can iterate on the snapshot representation to aid debugging later.
I'll extend this to `transformer_conformance` and `oxc-monitor` in an up coming PR.
2024-08-16 07:05:11 +00:00
rzvxa
8e8fcd0584
refactor(ast_tools): rename oxc_ast_codegen to oxc_ast_tools. ( #4846 )
...
This PR renames the `oxc_ast_codegen` crate to `oxc_ast_tools`, It improves the readability and organization of the codebase by giving the crate a name that better reflects its purpose and contents.
It also improves the error message in CI.
2024-08-12 14:33:58 +00:00
DonIsaac
8ec7e1204a
chore: alias new-typescript-rule to new-ts-rule ( #4824 )
...
This is the command suggested to users on our `typescript-eslint` mega-issue #2180 .
This should help reduce confusion.
2024-08-11 15:27:53 +00:00
DonIsaac
f6258ae126
chore: add 'just fix' command ( #4823 )
...
Fixes all auto-fixable issues from rustfmt, taplo, typos, and clippy.
2024-08-11 15:27:53 +00:00
DonIsaac
3d40528588
feat(linter): add fix emoji to rules table and doc pages ( #4715 )
...
Rules table:
<img width="898" alt="image" src="https://github.com/user-attachments/assets/353052aa-0af3-4c09-8441-ff79f4561ca0 ">
Doc pages:
<img width="918" alt="image" src="https://github.com/user-attachments/assets/cb43cb2d-15ff-41e6-8523-145cfbc3f484 ">
2024-08-10 22:50:47 +00:00
dalaoshu
970c36942c
chore: support windows shell for just ( #4795 )
...
closes #4794
2024-08-10 14:24:14 +08:00
dalaoshu
6cf38cb776
chore(tasks): support init vitest lint rule ( #4752 )
...
Related to #4656
2024-08-08 16:27:50 +08:00
Jelle van der Waa
1f8968a521
feat(linter): Add eslint-plugin-promise rules: avoid-new, no-new-statics, params-names ( #4293 )
...
This introduces the `eslint-plugin-promise` plugin and implements three
relatively simple rules.
Split off from https://github.com/oxc-project/oxc/pull/4252
2024-07-17 09:21:20 +08:00
rzvxa
96af45933a
chore(justfile): add just check to the just ast command. ( #4302 )
...
I use this in my local environment when I'm developing the ast_codegen
and want a thorough build with the newly generated files. If you find it
useful merge otherwise feel free to close.
2024-07-16 23:58:29 +08:00
Boshen
f85188b1af
chore: sync ast changes
2024-07-15 10:51:38 +08:00
rzvxa
e6c407d1c3
chore(ci): add Codegen to the CI workflow. ( #4144 )
...
It should be marked as `required`.
Closes #4138
---------
Co-authored-by: Boshen <boshenc@gmail.com>
2024-07-10 09:47:30 +08:00
Boshen
0511a1b014
chore(justfile): run cargo shear in just ready
2024-06-20 23:27:46 +08:00
Boshen
a11bdae1bb
chore(justfile): add a pre-commit hook
...
closes #3741
2024-06-19 20:09:42 +08:00
Boshen
c041e9d1a9
chore: bump test262, babel and TypeScript submodules ( #3644 )
2024-06-12 18:42:32 +08:00
Boshen
f849efa550
chore: fix build-wasm command
2024-06-07 17:05:46 +08:00
Boshen
515deb6165
chore: add cargo oxlint command
2024-05-28 11:10:08 +08:00
Boshen
2aba5beadb
chore(justfile): add wasm build commands
2024-05-26 20:55:49 +08:00
Boshen
21505e885c
refactor(cli): move crates/oxc_cli to apps/oxlint ( #3413 )
...
We need to split the cli crate up to reduce dependencies,
the current cli crate is pulling in `oxc_prettier`, which is redundant
for the linter.
2024-05-26 05:00:30 +00:00
Boshen
ed54eca119
chore(justfile): remove cargo-edit in favor of renovate bot
2024-05-24 13:50:40 +08:00
Boshen
101f7af201
chore(justfile): add website codegen command
2024-05-24 13:47:35 +08:00
Boshen
4f76cb6f38
refactor(linter): merge deepscan rules into oxc rules ( #3327 )
2024-05-17 11:56:06 +00:00
Dunqing
f38d138d97
chore: update the test-transformer command to support passing arguments ( #3286 )
2024-05-15 12:57:52 +08:00
Dunqing
a227050ed0
chore: update babel repo ( #3205 )
2024-05-08 20:15:15 +08:00
Boshen
233654af54
chore: update MAINTENANCE.md
2024-04-20 16:59:47 +08:00
Boshen
93ce5a919a
chore: fix internal doc warnings
2024-04-13 15:59:24 +08:00
Boshen
f3a28c61b9
chore(transform_conformance): enable typescript plugin snapshot
2024-04-11 20:06:53 +08:00
Boshen
95fc28168c
chore: apply cargo autoinherit ( #2826 )
...
See https://github.com/mainmatter/cargo-autoinherit
2024-03-26 23:57:50 +08:00
Ali Rezvani
f9d6f33a80
ci(coverage): update babel version. ( #2813 )
...
This PR updates the babel submodule in the justfile to take advantage of
[this PR](https://github.com/babel/babel/pull/16381 ). Related to #2795
and #2797 .
2024-03-26 09:42:19 +08:00
Boshen
ef1108a749
chore: Rust v1.77.0 ( #2781 )
2024-03-21 17:21:57 +00:00
Wang Wenzhe
975bc05f76
chore(tasks): remove unused rulegen command ( #2667 )
2024-03-10 23:00:22 +08:00
Wang Wenzhe
f8e8af2a66
feat(task): init eslint-plugin-tree-shaking rule ( #2662 )
2024-03-10 22:07:34 +08:00
Boshen
e8dc68c525
chore: update prettier to v3.2.5 ( #2332 )
2024-02-06 22:55:43 +08:00
Boshen
d2f7ea2923
chore: manually clone git modules instead of using submodules ( #2274 )
...
closes #2231
Submodules are a blocker for beginners, we should make it clone on
demand.
It is also a blocker for people who wants to target this repo as a crate
for testing purposes, cargo will do a full clone if you specify
oxc_parser = { git = "this repo" } in Cargo.toml
2024-02-02 11:56:18 +00:00