Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(format/html): add multiline for multi attributes #4972

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ cargo install just

But we **highly recommend** to [install it using an OS package manager](https://github.com/casey/just#packages), so you won't need to prefix every command with `cargo`.

Once installed, run the following command install the required tools:
Once installed, run the following command to install the required tools:

```shell
just install-tools
Expand All @@ -104,7 +104,7 @@ And you're good to go hack with Biome and Rust! 🚀

You can either use `cargo` or `just` to run tests. For simplicity and running tests real quick, use `cargo`.

With `cargo`, you can run tests with using the `test` command:
With `cargo`, you can run tests by using the `test` command:

```shell
# run tests
Expand All @@ -131,7 +131,7 @@ cd crates/biome_js_formatter
cargo t quick_test
```

This will run the `quick_test` test inside he `biome_js_formatter` crate. You should see an output similar to this:
This will run the `quick_test` test inside the `biome_js_formatter` crate. You should see an output similar to this:

```shell
running 1 test
Expand Down
61 changes: 46 additions & 15 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,34 @@ This document outlines the governance model for Biome.

It describes various parts of how the project is managed as well as accepted practices for day-to-day operation:

- [Contributor Model](#contributor-model)
- [Project Direction](#project-direction)
- [Code Review](#code-review)
- [Financial Contributions](#financial-contributions)
- [Moderation](#moderation)
* [Contributor Model](#contributor-model)
+ [Lead](#lead)
- [Lead nomination](#lead-nomination)
+ [Core Contributor](#core-contributor)
- [Core contributor nomination](#core-contributor-nomination)
+ [Maintainer](#maintainer)
- [Maintainer nomination](#maintainer-nomination)
+ [Voting Rules](#voting-rules)
+ [Ownership](#ownership)
+ [Inactivity](#inactivity)
+ [Contributions](#contributions)
+ [Governance changes](#governance-changes)
* [Project Direction](#project-direction)
+ [Roadmap](#roadmap)
* [Code review](#code-review)
* [Financial Contributions](#financial-contributions)
+ [Sponsorship](#sponsorship)
+ [Community-Funded Bounties](#community-funded-bounties)
+ [Project-Funded Bounties](#project-funded-bounties)
+ [Paid Contracting](#paid-contracting)
+ [Fund Allocation](#fund-allocation)
- [Expenses](#expenses)
* [Moderation](#moderation)
+ [Reporting](#reporting)
+ [Who gets involved?](#who-gets-involved)
+ [Review](#review)
+ [Resolution](#resolution)


## Contributor Model

Expand All @@ -21,16 +44,18 @@ Leads are the owners of the organisation.
Leads have additional privileges over core contributors. Leads control and maintain sensitive project assets and act as tiebreakers in the event of disagreements. In case of disagreements, only **one** lead must be involved in the resolution.

These assets and responsibilities are but are not limited to:
- Access to social accounts
- Administration privileges of the [Biome Discord server][discord]
- Administration privileges of the [Biome GitHub org][gh-org]
- Website accesses (hosting platform, domain name, etc.)
- Access to sensitive emails, such as the CoC email
- Access to social accounts.
- Administration privileges of the [Biome Discord server][discord].
- Administration privileges of the [Biome GitHub org][gh-org].
- Website credentials (hosting platform, domain name, etc.).
- Access to sensitive emails, such as the CoC email.

Also:
- Ability to vote for new leads
- Onboard new [core contributors](#core-contributor) and new leads;
- Takes part in [project decisions](#project-direction-and-planning)
- Ability to vote for new leads.
- Onboard new [core contributors](#core-contributor) and new leads.
- Takes part in [project decisions](#project-direction-and-planning).
- Access to the Discord `Lead` category and channels that belong to this category.
- Propose changes to the governance document via PR.

The ownership of assets is only sometimes evenly distributed among all the leads.

Expand Down Expand Up @@ -58,6 +83,8 @@ Core Contributors are outstanding [maintainers](#maintainer), are ambassadors of
- Ability to [vote](#maintainer-nomination) on new maintainers and [vote](#core-contributor-nomination) on new core contributors
- Onboard new [maintainers](#maintainer)
- Assign [pledges to issues](#bounties).
- Access to the Discord `Core contributors` category and channels that belong to this category.
- Propose changes to the governance document via PR.

#### Core contributor nomination

Expand Down Expand Up @@ -93,7 +120,7 @@ Maintainers are those with a history of consistent contributions, including but
- `Maintainer` status on the [Biome Discord server][discord]
- Ability to [vote](#voting) on project decisions
- Ability to [vote](#maintainer-nomination) on new maintainers

- Access to the Discord `Maintainers` category and channels that belong to this category.
#### Maintainer nomination

Maintainers may either be nominated by another [maintainer](#maintainer), [Core contributor](#core-contributor), [lead](#lead).
Expand Down Expand Up @@ -148,6 +175,10 @@ Contributions to the project aren't only limited to code. Contributions come in
- Support in secondary channels, e.g. StackOverflow, etc.
- Website;

### Governance changes

Changes to the governance document must be approved by at least fifty percent of the Core Contributors and a majority of the Leads.

## Project Direction

Project direction and planning is a shared responsibility amongst members. Core contributors are responsible for dictating high-level goals and the project scope that should be adhered to.
Expand Down Expand Up @@ -247,7 +278,7 @@ conditions:
or indirectly benefits the roadmap, a customized fee may be negotiated.
- If the last-published roadmap is more than 12 months old, the Core Contributor is asked to
consult with the Core team about alignment with the project goals.
- Fee negotiation may happen either publically in the `Community > #funding` channel, or privately
- Fee negotiation may happen either publicly in the `Community > #funding` channel, or privately
in the `Core > #core-team` channel.
- Custom fees require the approval of at least one Lead.
- The work may not conflict with the project direction or
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_analyze/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ See the [code generation section](#code-generation) for more details.

To create a new rule, you have to create and update several files.
Because it is a bit tedious, _Biome_ provides an easy way to create and test your rule using [Just](https://just.systems/man/en/).
_Just_ is not part of the rust toolchain, you have to install it with [a package manager](https://just.systems/man/en/chapter_4.html).
_Just_ is not part of the rust toolchain, you have to install it with [a package manager](https://just.systems/man/en/packages.html).

### Guidelines

Expand Down
3 changes: 2 additions & 1 deletion crates/biome_html_formatter/src/html/lists/attribute_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ pub(crate) struct FormatHtmlAttributeList;
impl FormatRule<HtmlAttributeList> for FormatHtmlAttributeList {
type Context = HtmlFormatContext;
fn fmt(&self, node: &HtmlAttributeList, f: &mut HtmlFormatter) -> FormatResult<()> {
let line_break = if f.options().attribute_position() == AttributePosition::Multiline {
let attribute_len = node.iter().len();
let line_break = if attribute_len > 1 || f.options().attribute_position() == AttributePosition::Multiline {
Geun-Oh marked this conversation as resolved.
Show resolved Hide resolved
hard_line_break()
} else {
soft_line_break_or_space()
Expand Down
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test case has the setting set to auto. add new tests in a new folder with an options.json to set the attibute multiline setting to multiline. See #4968 for an example of how to do this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I've added code lines to override options from options.json.

And also add tests & snapshots in new dir multiline.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div foo="bar" id="foo"></div>
<div foo="bar"></div>
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
source: crates/biome_formatter_test/src/snapshot_builder.rs
assertion_line: 212
info: attributes/no-break.html
---
# Input

```html
<div foo="bar" id="foo"></div>
<div foo="bar"></div>

```

Expand All @@ -25,5 +26,5 @@ Attribute Position: Auto
-----

```html
<div foo="bar" id="foo"></div>
<div foo="bar"></div>
```
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: crates/biome_formatter_test/src/snapshot_builder.rs
assertion_line: 212
info: attributes/single-quotes.html
---
# Input
Expand All @@ -25,5 +26,8 @@ Attribute Position: Auto
-----

```html
<img src="foo.png'" alt='should keep "these" quotes' />
<img
src="foo.png'"
alt='should keep "these" quotes'
/>
```
3 changes: 3 additions & 0 deletions packages/@biomejs/biome/README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ Nous utilisons [Polar.sh](https://polar.sh/biomejs) pour voter pour des fonction
<td align="center" valign="middle">
<a href="https://www.phoenixlabs.dev/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://images.opencollective.com/phoenix-labs/2824ed4/logo/100.png?height=100" height="100"></a>
</td>
<td align="center" valign="middle">
<a href="https://lokalise.com/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://avatars.githubusercontent.com/u/14294501?s=200&v=4" height="100"></a>
</td>
</tr>
</tbody>
</table>
Expand Down
3 changes: 3 additions & 0 deletions packages/@biomejs/biome/README.hi.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ Biome एक सरल प्रायोजन[^37] कार्यक्रम
<td align="center" valign="middle">
<a href="https://www.phoenixlabs.dev/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://images.opencollective.com/phoenix-labs/2824ed4/logo/100.png?height=100" height="100"></a>
</td>
<td align="center" valign="middle">
<a href="https://lokalise.com/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://avatars.githubusercontent.com/u/14294501?s=200&v=4" height="100"></a>
</td>
</tr>
</tbody>
</table>
Expand Down
3 changes: 3 additions & 0 deletions packages/@biomejs/biome/README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ Biome についてもっと知るために[ホームページ][biomejs]をチェ
<td align="center" valign="middle">
<a href="https://www.phoenixlabs.dev/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://images.opencollective.com/phoenix-labs/2824ed4/logo/100.png?height=100" height="100"></a>
</td>
<td align="center" valign="middle">
<a href="https://lokalise.com/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://avatars.githubusercontent.com/u/14294501?s=200&v=4" height="100"></a>
</td>
</tr>
</tbody>
</table>
Expand Down
3 changes: 3 additions & 0 deletions packages/@biomejs/biome/README.kr.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ Biome은 기업이 다양한 개발자들 사이에서 인지도를 얻을 수
<td align="center" valign="middle">
<a href="https://www.phoenixlabs.dev/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://images.opencollective.com/phoenix-labs/2824ed4/logo/100.png?height=100" height="100"></a>
</td>
<td align="center" valign="middle">
<a href="https://lokalise.com/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://avatars.githubusercontent.com/u/14294501?s=200&v=4" height="100"></a>
</td>
</tr>
</tbody>
</table>
Expand Down
7 changes: 7 additions & 0 deletions packages/@biomejs/biome/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
> [!IMPORTANT]
> All new developments, fixes and features should be directed towards the `next` branch.
> The `main` is only used for maintenance and CI while the team prepares everything for v2.

<div align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/biomejs/resources/main/svg/slogan-dark-transparent.svg">
Expand Down Expand Up @@ -137,6 +141,9 @@ We use [Polar.sh](https://polar.sh/biomejs) to up-vote and promote specific feat
<td align="center" valign="middle">
<a href="https://www.phoenixlabs.dev/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://images.opencollective.com/phoenix-labs/2824ed4/logo/100.png?height=100" height="100"></a>
</td>
<td align="center" valign="middle">
<a href="https://lokalise.com/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://avatars.githubusercontent.com/u/14294501?s=200&v=4" height="100"></a>
</td>
</tr>
</tbody>
</table>
Expand Down
3 changes: 3 additions & 0 deletions packages/@biomejs/biome/README.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ Leia mais sobre nossa [filosofia de projeto][biome-philosophy].
<td align="center" valign="middle">
<a href="https://www.phoenixlabs.dev/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://images.opencollective.com/phoenix-labs/2824ed4/logo/100.png?height=100" height="100"></a>
</td>
<td align="center" valign="middle">
<a href="https://lokalise.com/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://avatars.githubusercontent.com/u/14294501?s=200&v=4" height="100"></a>
</td>
</tr>
</tbody>
</table>
Expand Down
3 changes: 3 additions & 0 deletions packages/@biomejs/biome/README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ Biome предлагает простую спонсорскую програм
<td align="center" valign="middle">
<a href="https://www.phoenixlabs.dev/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://images.opencollective.com/phoenix-labs/2824ed4/logo/100.png?height=100" height="100"></a>
</td>
<td align="center" valign="middle">
<a href="https://lokalise.com/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://avatars.githubusercontent.com/u/14294501?s=200&v=4" height="100"></a>
</td>
</tr>
</tbody>
</table>
Expand Down
3 changes: 3 additions & 0 deletions packages/@biomejs/biome/README.uk.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ Biome пропонує просту програму спонсорства, я
<td align="center" valign="middle">
<a href="https://www.phoenixlabs.dev/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://images.opencollective.com/phoenix-labs/2824ed4/logo/100.png?height=100" height="100"></a>
</td>
<td align="center" valign="middle">
<a href="https://lokalise.com/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://avatars.githubusercontent.com/u/14294501?s=200&v=4" height="100"></a>
</td>
</tr>
</tbody>
</table>
Expand Down
3 changes: 3 additions & 0 deletions packages/@biomejs/biome/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ npx @biomejs/biome ci ./src
<td align="center" valign="middle">
<a href="https://www.phoenixlabs.dev/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://images.opencollective.com/phoenix-labs/2824ed4/logo/100.png?height=100" height="100"></a>
</td>
<td align="center" valign="middle">
<a href="https://lokalise.com/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://avatars.githubusercontent.com/u/14294501?s=200&v=4" height="100"></a>
</td>
</tr>
</tbody>
</table>
Expand Down
3 changes: 3 additions & 0 deletions packages/@biomejs/biome/README.zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ Biome 提供了一個簡單的贊助計劃,允許公司在各種開發者中
<td align="center" valign="middle">
<a href="https://www.phoenixlabs.dev/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://images.opencollective.com/phoenix-labs/2824ed4/logo/100.png?height=100" height="100"></a>
</td>
<td align="center" valign="middle">
<a href="https://lokalise.com/?utm_source=biome&utm_medium=readme" target="_blank"><img src="https://avatars.githubusercontent.com/u/14294501?s=200&v=4" height="100"></a>
</td>
</tr>
</tbody>
</table>
Expand Down
Loading