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

Update docs to remove flake8, isort mentions and add ruff #502

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
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
13 changes: 5 additions & 8 deletions docs/developers/contributing/dev_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,11 @@ In order to make changes to `napari`, you will need to [fork](https://docs.githu
see [`black`'s documentation](https://black.readthedocs.io/en/stable/).

Code will also be linted to enforce the stylistic and logistical rules specified
in our [`flake8` configuration](https://github.com/napari/napari/blob/main/pyproject.toml), which currently ignores
[E203](https://lintlyci.github.io/Flake8Rules/rules/E203.html),
[E501](https://lintlyci.github.io/Flake8Rules/rules/E501.html),
[W503](https://lintlyci.github.io/Flake8Rules/rules/W503.html) and
[C901](https://lintlyci.github.io/Flake8Rules/rules/C901.html). For information
on any specific flake8 error code, see the [Flake8
Rules](https://lintlyci.github.io/Flake8Rules/). You may also wish to refer to
the [PEP 8 style guide](https://peps.python.org/pep-0008/).
in the `[tool.ruff]` section of
[our `pyproject.toml` file](https://github.com/napari/napari/blob/main/pyproject.toml).
For information on any specific `ruff` error code, see the
[Ruff Rules](https://docs.astral.sh/ruff/rules/). You may also wish to refer
to the [PEP 8 style guide](https://peps.python.org/pep-0008/).

If you wish to tell the linter to ignore a specific line use the `# noqa`
comment along with the specific error code (e.g. `import sys # noqa: E402`) but
Expand Down
2 changes: 1 addition & 1 deletion docs/developers/coredev/core_dev_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ As a core member, you should be familiar with the following napari guides:
for docstring conventions.
- [`pre-commit`](https://pre-commit.com) hooks for autoformatting.
- [`black`](https://github.com/psf/black) autoformatting.
- [`flake8`](https://github.com/PyCQA/flake8) linting.
- [`ruff`](https://github.com/astral-sh/ruff) linting.

### Social resources

Expand Down
8 changes: 1 addition & 7 deletions docs/plugins/virtual_environment_docs/4-developer-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Many are very helpful, but they do take a little time to learn. The more time yo

### Linting tools
These _check_ your code.
* [flake8](https://flake8.pycqa.org/) - checks various code style conventions, unused variables, line spacings, etc…
* [ruff](https://github.com/astral-sh/ruff) - checks various code style conventions, unused variables, line spacings, etc…
* [mypy](https://github.com/python/mypy)
- Static type checker: enforces proper usage of types.
- Super useful once you get the hang of it, but definitely an intermediate-advanced tool.
Expand All @@ -25,12 +25,6 @@ These _check_ your code.
These _auto-modify_ your code.
* [black](https://github.com/psf/black)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* [black](https://github.com/psf/black)
* [ruff-formater](https://docs.astral.sh/ruff/formatter/)

Forces code to follow specific style, indentations, etc...
Comment on lines 26 to 27
Copy link
Contributor

Choose a reason for hiding this comment

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

We are using ruff-format, not black now.
It is slimier to black, but not equivalent.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah right -I only see one rule though

https://github.com/napari/napari/blob/b9dc8dca1e1afa7567586e7ffa7a36cc7cd9fb6f/pyproject.toml#L245

so I'll again just point people to the pyproject.toml in case there are future updates.

Copy link
Contributor

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

@melissawm If you scroll down from your link, ruff is performing all of the task that you had in the original text since it is a drop-in replacement for these tools. Perhaps link out to ruff docs: https://docs.astral.sh/ruff/linter/#the-ruff-linter

* [autoflake](https://github.com/PyCQA/autoflake)
Auto-fixes some flake8 failures.
* [isort](https://github.com/PyCQA/isort)
Auto-sorts and formats your imports.
* [setup-cfg-fmt](https://github.com/asottile/setup-cfg-fmt)
Sorts and enforces conventions in setup.cfg.

### Pre-commit tools
* [pre-commit](https://pre-commit.com/), runs all your checks each time you run git commit, preventing bad code from ever getting checked in.
Expand Down
Loading