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

Configure & activate JuliaFormatter #946

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Removed pre-commit from CONTRIBUTING
clizbe committed Mar 22, 2024
commit e6a6557c483a3315255f55cafb0a0b80181ea943
4 changes: 2 additions & 2 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
margin = 120
margin = 119
always_for_in = true
remove_extra_newlines = true
whitespace_ops_in_indices = true
@@ -11,4 +11,4 @@ join_lines_based_on_source = true
surround_whereop_typeparameters = true
trailing_comma = "nothing"
align_conditional = true
annotate_untyped_fields_with_any = true
annotate_untyped_fields_with_any = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

annotate_untyped_fields_with_any = true? I think this should be false.

trailing_comma = "nothing"? we could have true here I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah we can set untyped_fields to false.
For the trailing_comma, I set it to nothing because it seems we like using it in some cases and not in others, and I assumed there was a reason. But if there's no reason we can just enforce it. :)

24 changes: 0 additions & 24 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -46,30 +46,6 @@ In VSCode, you can activate "Format on Save" for `JuliaFormatter`.
To do so, open VSCode Settings (<kbd>Ctrl</kbd> + <kbd>,</kbd>), then in "Search
Settings", type "Format on Save" and tick the first result.

## Using pre-commit

Install [pre-commit](https://pre-commit.com) to run the linters and formatters.

You can install `pre-commit` globally using

```bash
pip install --user pre-commit
```

If you prefer to create a local environment with it, do the following:

```bash
python -m venv env
. env/bin/activate
pip install --upgrade pip setuptools pre-commit
```

On Windows, you need to active the environment using the following command instead of the previous one:

```bash
. env/Scrips/activate
```

## Further questions

* For developers there is some additional information in the implementation details (e.g. how to write a constraint).