diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index b22a1d40b..59609e4f1 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -88,13 +88,6 @@ jobs: run: | cargo clippy cargo run -p rules_check - # - name: Check for git diff after lint fix - # run: | - # if [[ $(git status --porcelain) ]]; then - # git status - # git diff - # exit 1 - # fi # check-dependencies: # name: Check Dependencies @@ -183,7 +176,7 @@ jobs: run: cargo run -p xtask_codegen -- configuration - name: Run the docs codegen run: cargo run -p docs_codegen - - name: Check for git diff + - name: Check for git diff -- run "just ready" if you see an error run: | if [[ $(git status --porcelain) ]]; then git status diff --git a/justfile b/justfile index aafa199fd..8fcec7b63 100644 --- a/justfile +++ b/justfile @@ -3,9 +3,8 @@ _default: alias f := format alias t := test -# alias r := ready +alias r := ready alias l := lint -# alias qt := test-quick # Installs the tools needed to develop install-tools: @@ -17,19 +16,6 @@ upgrade-tools: cargo install cargo-binstall --force cargo binstall cargo-insta taplo-cli --force -# Generate all files across crates and tools. You rarely want to use it locally. -gen-all: - cargo run -p xtask_codegen -- all - # cargo codegen-configuration -# cargo codegen-migrate -# just gen-bindings -# just format - -# Generates TypeScript types and JSON schema of the configuration -# gen-bindings: -# cargo codegen-schema -# cargo codegen-bindings - # Generates code generated files for the linter gen-lint: cargo run -p xtask_codegen -- analyser @@ -39,22 +25,12 @@ gen-lint: cargo run -p rules_check just format -# Generates the linter documentation and Rust documentation -# documentation: -# RUSTDOCFLAGS='-D warnings' cargo documentation - # Creates a new lint rule in the given path, with the given name. Name has to be camel case. Group should be lowercase. new-lintrule group rulename: cargo run -p xtask_codegen -- new-lintrule --category=lint --name={{rulename}} --group={{group}} just gen-lint # just documentation -# Creates a new lint rule in the given path, with the given name. Name has to be camel case. -# new-assistrule rulename: -# cargo run -p xtask_codegen -- new-lintrule --kind=js --category=assist --name={{rulename}} -# just gen-lint -# just documentation - # Format Rust files and TOML files format: cargo fmt @@ -80,27 +56,6 @@ test-crate name: test-doc: cargo test --doc -# Tests a lint rule. The name of the rule needs to be camel case -# test-lintrule name: -# just _touch crates/biome_js_analyze/tests/spec_tests.rs -# just _touch crates/biome_json_analyze/tests/spec_tests.rs -# just _touch crates/biome_css_analyze/tests/spec_tests.rs -# just _touch crates/biome_graphql_analyze/tests/spec_tests.rs -# cargo test -p biome_js_analyze -- {{snakecase(name)}} --show-output -# cargo test -p biome_json_analyze -- {{snakecase(name)}} --show-output -# cargo test -p biome_css_analyze -- {{snakecase(name)}} --show-output -# cargo test -p biome_graphql_analyze -- {{snakecase(name)}} --show-output - -# Tests a lint rule. The name of the rule needs to be camel case -# test-transformation name: -# just _touch crates/biome_js_transform/tests/spec_tests.rs -# cargo test -p biome_js_transform -- {{snakecase(name)}} --show-output - -# Run the quick_test for the given package. -# test-quick package: -# cargo test -p {{package}} --test quick_test -- quick_test --nocapture --ignored - - # Alias for `cargo clippy`, it runs clippy on the whole codebase lint: cargo clippy @@ -110,16 +65,14 @@ lint-fix: cargo clippy --fix cargo run -p rules_check -# When you finished coding, run this command to run the same commands in the CI. -# ready: -# git diff --exit-code --quiet -# just gen-all -# just documentation -# #just format # format is already run in `just gen-all` -# just lint -# just test -# just test-doc -# git diff --exit-code --quiet +# When you finished coding, run this command. Note that you should have already committed your changes. +ready: + git diff --exit-code --quiet + cargo run -p xtask_codegen -- configuration + cargo run -p docs_codegen + just lint-fix + just format + git diff --exit-code --quiet # Creates a new crate new-crate name: @@ -130,14 +83,6 @@ new-crate name: tree-print file: cargo run --bin tree_print -- -f {{file}} -# Creates a new changeset for the final changelog -# new-changeset: -# knope document-change - -# Dry-run of the release -# dry-run-release *args='': -# knope release --dry-run {{args}} - clear-branches: git branch --merged | egrep -v "(^\\*|main)" | xargs git branch -d