Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into integr-docs
Browse files Browse the repository at this point in the history
* upstream/main: (73 commits)
  fix(semantic_analyzers): style/noShoutyConstants does not recognize multiple uses of a constant. (rome#3789)
  feat(rome_js_analyze): useDefaultSwitchClauseLast (rome#3791)
  chore: run rustfmt and typo fix (rome#3840)
  feat(rome_js_analyze): use exhaustive deps support properties (rome#3581)
  website(docs): Fix text formatting (rome#3828)
  feat(rome_js_analyze): `noVoidTypeReturn` (rome#3806)
  feat(rome_cli): expose the `--verbose` flag to the CLI (rome#3812)
  fix(rome_diagnostics): allow diagnostic locations to be created without a resource (rome#3834)
  feat(rome_js_analyze): add noExtraNonNullAssertion rule (rome#3797)
  fix(rome_lsp): lsp friendly catch unwind (rome#3740)
  feat(rome_js_semantic): model improvements (rome#3825)
  feat(rome_json_parser): JSON Lexer (rome#3809)
  feat(rome_js_analyze): implement `noDistractingElements` (rome#3820)
  fix(rome_js_formatter): shothanded named import line break with default import (rome#3826)
  feat(rome_js_analyze): `noConstructorReturn` (rome#3805)
  feat(website): change enabledNurseryRules to All/Recommended select (rome#3810)
  feat(rome_js_analyze): noSetterReturn
  feat(rome_js_analyze): noConstructorReturn
  feat(rome_analyze): suppress rule via code actions (rome#3572)
  feat(rome_js_analyze): `noVar` (rome#3765)
  ...
  • Loading branch information
jeysal committed Nov 24, 2022
2 parents 183a666 + f1df39c commit 0ac7801
Show file tree
Hide file tree
Showing 1,270 changed files with 341,920 additions and 6,340 deletions.
5 changes: 4 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
* text=auto eol=lf
crates/rome_js_parser/src/lexer/tables.rs linguist-generated=true text=auto eol=lf
crates/rome_js_unicode_table/src/tables.rs linguist-generated=true text=auto eol=lf
**/generated/* linguist-generated=true text=auto eol=lf
crates/rome_js_analyze/src/analyzers.rs linguist-generated=true text=auto eol=lf
crates/rome_js_analyze/src/assists.rs linguist-generated=true text=auto eol=lf
Expand All @@ -11,6 +11,8 @@ crates/rome_js_analyze/src/registry.rs linguist-generated=true text=auto eol=lf
crates/rome_service/src/configuration/linter/rules.rs linguist-generated=true text=auto eol=lf
npm/backend-jsonrpc/src/workspace.ts linguist-generated=true text=auto eol=lf
website/src/docs/lint/rules/**/*.md linguist-generated=true text=auto eol=lf
npm/rome/configuration_schema.json linguist-generated=true text=auto eol=lf
editors/vscode/configuration_schema.json linguist-generated=true text=auto eol=lf


crates/rome_js_formatter/tests/**/*.ts.prettier-snap linguist-language=TypeScript
Expand All @@ -20,3 +22,4 @@ crates/rome_js_formatter/tests/**/*.js.snap linguist-language=Markdown
crates/rome_cli/tests/**/*.snap linguist-language=Markdown
crates/rome_js_analyze/tests/specs/**/*.snap linguist-language=Markdown


6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
/crates/rome_js_parser @MichaReiser @xunilrj

# analyzers
/crates/rome_*analyze @leops @xunilrj
/crates/rome_*analyze @leops @xunilrj @ematipico

/crates/rome_control_flow @leops
/crates/rome_js_semantic @xunilrj
/crates/rome_console @leops
/crates/rome_fs @leops
/crates/rome_fs @leops @ematipico
/crates/rome_markup @leops
/crates/rome_service @leops @ematipico
/crates/rome_lsp @ematipico
/crates/rome_cli @leops
/crates/rome_cli @leops @ematipico
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/01_bug.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 🐛 Bug Report
description: Report a possible bug or regression
title: "🐛 <TITLE>"
labels: ["S-Bug: unconfirmed"]
labels: ["S-To triage"]
body:
- type: markdown
attributes:
Expand Down
99 changes: 99 additions & 0 deletions .github/workflows/bench_cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# CLI benchmark, compares main and PR branch with Hyperfine.
# Comment with text containing `!bench_cli`, a new result will be commented at the bottom of this PR.

name: CLI Benchmark

on:
issue_comment:
types: [ created ]

env:
RUST_LOG: info

jobs:
bench:
name: Bench
if: github.event.issue.pull_request && contains(github.event.comment.body, '!bench_cli')
runs-on: ubuntu-latest

steps:
- name: Get PR SHA
id: sha
uses: actions/github-script@v6
with:
result-encoding: string
script: |
const response = await github.request(context.payload.issue.pull_request.url);
return response.data.head.sha;
- name: Checkout PR Branch
uses: actions/checkout@v3
with:
submodules: false
ref: ${{ steps.sha.outputs.result }}

- name: Install toolchain
run: rustup show

- name: Cache
uses: Swatinem/rust-cache@v1

- name: Install hyperfine
run: cargo install hyperfine

- name: Compile on PR Branch
run: |
cargo build --release --bin rome
mkdir -p benchmark/target
cp target/release/rome benchmark/target/rome_pr
- name: Checkout Main Branch
uses: actions/checkout@v3
with:
clean: false
ref: main

- name: Compile on Main Branch
run: |
cargo build --release --bin rome
cp target/release/rome benchmark/target/rome_main
- name: Checkout webpack
uses: actions/checkout@v3
with:
repository: webpack/webpack
path: benchmark/target/webpack
- name: Checkout prettier
uses: actions/checkout@v3
with:
repository: prettier/prettier
path: benchmark/target/prettier
- name: Checkout eslint
uses: actions/checkout@v3
with:
repository: eslint/eslint
path: benchmark/target/eslint

- name: Run Benchmarks
id: benchmarks
working-directory: benchmark/target
env:
FORMAT_BENCH_COMMAND: "format webpack/lib webpack/examples webpack/declarations webpack/benchmark prettier/src prettier/scripts --write"
CHECK_BENCH_COMMAND: "--max-diagnostics=0 eslint/lib eslint/messages eslint/tests/lib eslint/tests/performance eslint/tools webpack/lib"
run: |
hyperfine -w 2 --export-markdown benchmark_format.md \
-n "rome format (main)" "./rome_main $FORMAT_BENCH_COMMAND" \
-n "rome format (pr)" "./rome_pr $FORMAT_BENCH_COMMAND"
hyperfine -w 2 --export-markdown benchmark_check.md \
-n "rome check (main)" "./rome_main check $CHECK_BENCH_COMMAND" \
-n "rome check (pr)" "./rome_pr check $CHECK_BENCH_COMMAND"
cat benchmark_format.md >> benchmark.md
echo $'\n' >> benchmark.md
cat benchmark_check.md >> benchmark.md
- name: Write a new comment
uses: peter-evans/create-or-update-comment@v2
continue-on-error: true
with:
issue-number: ${{ github.event.issue.number }}
body-file: benchmark/target/benchmark.md
10 changes: 5 additions & 5 deletions .github/workflows/parser_conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ on:
branches:
- main
paths:
- 'crates/rome_js_syntax/**/*'
- 'crates/rome_js_factory/**/*'
- 'crates/rome_js_parser/**/*'
- 'crates/rome_rowan/**/*'
- 'xtask/**/*'
- 'crates/rome_js_syntax/**'
- 'crates/rome_js_factory/**'
- 'crates/rome_js_parser/**'
- 'crates/rome_rowan/**'
- 'xtask/**'

env:
RUST_LOG: info
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/release_lsp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,28 @@ jobs:
node-version: 14.x
registry-url: 'https://registry.npmjs.org'

- name: Publish extension (pre-release)
- name: Publish extension to Microsoft Marketplace (pre-release)
run: npx vsce publish --pre-release --packagePath rome_lsp-*.vsix
if: needs.build.outputs.prerelease == 'true'
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Publish extension
- name: Publish extension to Microsoft Marketplace
run: npx vsce publish --packagePath rome_lsp-*.vsix
if: needs.build.outputs.prerelease != 'true'
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}

- name: Publish extension to Open VSX (pre-release)
run: npx ovsx publish --pre-release --packagePath rome_lsp-*.vsix
if: needs.build.outputs.prerelease == 'true'
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
- name: Publish extension to Open VSX
run: npx ovsx publish --packagePath rome_lsp-*.vsix
if: needs.build.outputs.prerelease != 'true'
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}

- name: Create GitHub release and tag
uses: softprops/action-gh-release@v1
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/stale@v6
with:
stale-issue-message: 'This issue is stale because it has been open 14 days with no activity.'
stale-issue-message: '👋 @rome/staff please triage this issue by adding one of the following labels: `S-Bug: confirmed`, `S-Planned` , `S-Wishlist` or `umbrella`'
stale-pr-message: 'This PR is stale because it has been open 14 days with no activity.'
days-before-issue-stale: 14
days-before-pr-stale: 14
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,17 @@ from the main repository (not a fork), use these comments to run specific workfl
### Analyzers and lint rules

To know the technical details of how our analyzer works, how to create a rule and how to write tests, please check our [internal
documentation page](https://rome.github.io/tools/rome_analyze/index.html)
documentation page](https://rustdocs.rome.tools/rome_analyze/index.html)

### JavaScript Parser

To know the technical details of how our JavaScript works and how to write test, please check our [internal
documentation page](https://rome.github.io/tools/rome_js_parser/index.html)
documentation page](https://rustdocs.rome.tools/rome_js_parser/index.html)

### Formatter

To know the technical details of how our formatter works and how to write test, please check our [internal
documentation page](https://rome.github.io/tools/rome_js_formatter/index.html)
documentation page](https://rustdocs.rome.tools/rome_js_formatter/index.html)

### Versioning

Expand Down
32 changes: 32 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/rome_analyze/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ rustc-hash = { workspace = true }
serde = { version = "1.0.136", features = ["derive"] }
serde_json = { version = "1.0.85", features = ["raw_value"]}
schemars = { version = "0.8.10", optional = true }
tracing = { workspace = true }

[dev-dependencies]
rome_js_syntax = { path = "../rome_js_syntax" }
Expand Down
Loading

0 comments on commit 0ac7801

Please sign in to comment.