Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Commit f349182

Browse files
authored
chore: update contribution guidelines (#3996)
1 parent 7dfcd34 commit f349182

File tree

4 files changed

+65
-24
lines changed

4 files changed

+65
-24
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,16 @@
1717
## Test Plan
1818

1919
<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output. -->
20+
21+
## Documentation
22+
23+
<!--
24+
25+
Read the following paragraph for more information: https://github.com/rome/tools/blob/main/CONTRIBUTING.md#documentation
26+
27+
Tick the checkboxes if your PR requires some documentation, and if you will follow up with that
28+
29+
-->
30+
31+
- [ ] The PR requires documentation
32+
- [ ] I will create a new PR to update the documentation

CONTRIBUTING.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,20 @@ test(lint): add more cases to handle invalid rules
175175

176176
When creating a new pull request, it's preferable to use a conventional commit-formatted title, as this title will be used as the default commit message on the squashed commit after merging.
177177

178+
Please use the template provided.
179+
180+
#### Documentation
181+
182+
If your PR requires some update on the website (new features, breaking changes, etc.), you should create a new PR once the previous PR is successfully merged.
183+
184+
Go to the issues section and check the pinned issues.
185+
You will find a _**pinned issue**_ that starts with "Documentation and Focus". Inside, you will find the details of:
186+
- the name of the branch where to point the PR that updates the documentation;
187+
- the PR that we will merge when the release is ready;
188+
189+
If you can't create a new PR, please let the team know.
190+
The template should help to give all the information to the team.
191+
178192
Here are some other scripts that you might find useful.
179193

180194
#### If you are a core contributor
@@ -220,7 +234,22 @@ the new snapshot tests.
220234

221235
### Using just
222236

223-
A lot of the commands above are mor easily acessible using our Just recipes. For example:
237+
A lot of the commands above are mor easily accessible using our [Just](https://just.systems/man/en/) recipes. For example:
238+
239+
### Install just
240+
241+
You can install `just` using cargo:
242+
243+
```shell
244+
cargo install just
245+
```
246+
247+
Or, using different methods, like explained in their [documentation](https://just.systems/man/en/chapter_4.html).
248+
249+
It's advised to install `just` using a package manager, so
250+
you can run `just` as a binary.
251+
252+
### Usage
224253

225254
```ignore
226255
❯ just

crates/rome_analyze/CONTRIBUTING.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Analyzer
22

33
The analyzer is a generic crate aimed to implement a visitor-like infrastructure, where
4-
it's possible to inspect a piece of AST and emit diagnostics or actions based on a
4+
it's possible to inspect a piece of AST and emit diagnostics or actions based on a
55
static check.
66

77
# Folder structure
@@ -11,8 +11,9 @@ is going to be implemented for the JavaScript language (and its super languages)
1111
will be implemented inside the `rome_js_analyze` crate.
1212

1313
Rules are divided by capabilities:
14-
- `analyzers/` folder contains rules that don't require any particular capabilities;
15-
- `semantic_analyzer/` folder contains rules that require the use of the semantic model;
14+
- `analyzers/` folder contains rules that don't require any particular capabilities, via the `Ast<>` query type;
15+
- `semantic_analyzer/` folder contains rules that require the use of the semantic model, via `Semantic<>` query type;
16+
- `aria_analyzers/` folder contains rules that require the use ARIA metadata, via `Aria<>` query type;
1617
- `assists/` folder contains rules that contribute to refactor code, with not associated diagnostics;
1718
these are rules that are usually meant for editors/IDEs;
1819

@@ -52,10 +53,10 @@ inside the `semantic_analyzers` folder
5253
3. from there, use the [`declare_rule`](#declare_rule) macro to create a new type
5354
```rust,ignore
5455
use rome_analyze::declare_rule;
55-
56+
5657
declare_rule! {
5758
/// Promotes the use of awesome tricks
58-
///
59+
///
5960
/// ## Examples
6061
///
6162
/// ### Invalid
@@ -72,25 +73,23 @@ inside the `semantic_analyzers` folder
7273
use rome_analyze::{Rule, RuleCategory};
7374
use rome_js_syntax::JsAnyExpression;
7475
use rome_analyze::context::RuleContext;
75-
76+
7677
impl Rule for UseAwesomeTricks {
77-
const CATEGORY: RuleCategory = RuleCategory::Lint;
7878
type Query = Semantic<JsAnyExpression>;
7979
type State = String;
8080
type Signals = Option<Self::State>;
8181
type Options = ();
82-
82+
8383
fn run(ctx: &RuleContext<Self>) -> Self::Signals {}
8484
}
8585
```
86-
5. the const `CATEGORY` must be `RuleCategory::Lint` otherwise it won't work
87-
6. the `Query` needs to have the `Semantic` type, because we want to have access to the semantic model.
88-
`Query` tells the engine on which AST node we want to trigger the rule.
89-
7. The `State` type doesn't have to be used, so it can be considered optional, but it has
86+
5. the `Query` needs to have the `Semantic` type, because we want to have access to the semantic model.
87+
`Query` tells the engine on which AST node we want to trigger the rule.
88+
6. The `State` type doesn't have to be used, so it can be considered optional, but it has
9089
be defined as `type State = ()`
91-
8. The `run` function must be implemented. This function is called every time the analyzer
90+
7. The `run` function must be implemented. This function is called every time the analyzer
9291
finds a match for the query specified by the rule, and may return zero or more "signals".
93-
9. Implement the optional `diagnostic` function, to tell the user where's the error and why:
92+
8. Implement the optional `diagnostic` function, to tell the user where's the error and why:
9493
```rust,ignore
9594
impl Rule for UseAwesomeTricks {
9695
// .. code
@@ -99,11 +98,11 @@ finds a match for the query specified by the rule, and may return zero or more "
9998
```
10099
While implementing the diagnostic, please keep [Rome's technical principals](https://rome.tools/#technical) in mind.
101100
This function is called of every signal emitted by the `run` function, and it may return
102-
zero or one diagnostic.
101+
zero or one diagnostic.
103102
104103
You will have to manually update the file `rome_diagnostics_categories/src/categories.rs` and add a new category
105104
for the new rule you're about to create.
106-
10. Implement the optional `action` function, if we are able to provide automatic code fix to the rule:
105+
9. Implement the optional `action` function, if we are able to provide automatic code fix to the rule:
107106
```rust,ignore
108107
impl Rule for UseAwesomeTricks {
109108
// .. code
@@ -225,9 +224,9 @@ declare_rule! {
225224
use rome_analyze::declare_rule;
226225
declare_rule! {
227226
/// Disallow the use of `var`
228-
///
227+
///
229228
/// ### Invalid
230-
///
229+
///
231230
/// ```js,expect_diagnostic
232231
/// var a, b;
233232
/// ```
@@ -255,9 +254,9 @@ use rome_analyze::declare_rule;
255254
256255
declare_rule! {
257256
/// Disallow the use of `var`
258-
///
257+
///
259258
/// ### Invalid
260-
///
259+
///
261260
/// ```js,expect_diagnostic
262261
/// var a, b;
263262
/// ```
@@ -409,4 +408,4 @@ And at the end, to test our commits are ready to be push we can call
409408
> just check-ready
410409
```
411410

412-
For more details on the available automations, look at our `justfile` at the root of the repository.
411+
For more details on the available automations, look at our `justfile` at the root of the repository.

justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
_default:
22
just --list -u
3-
3+
44
codegen:
55
cargo codegen all
66
cargo codegen-configuration
77
cargo codegen-schema
88
cargo codegen-bindings
9-
9+
1010
documentation:
1111
cargo lintdoc
1212
cargo documentation

0 commit comments

Comments
 (0)