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

Add docs for the cutter #16

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add docs for the cutter #16

wants to merge 2 commits into from

Conversation

unkcpz
Copy link
Member

@unkcpz unkcpz commented Dec 5, 2023

No description provided.

@unkcpz
Copy link
Member Author

unkcpz commented Dec 5, 2023

Some update on the cutter, here this PR is updating the pre-commit which is not working anymore, and changed to ruff.
In this PR the docs template is added using mkdocs with its materials theme.
More changes are needed but by other PRs, such as remove the start.py and updating the outdated tests templates.

Copy link

@danielhollas danielhollas left a comment

Choose a reason for hiding this comment

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

Thanks for doing this @unkcpz! Couple of suggestions regarding ruff config.
We also need to update GHA config but that's a separate PR.

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.4

Choose a reason for hiding this comment

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

Update to latest version

Suggested change
rev: v0.1.4
rev: v0.1.7

Choose a reason for hiding this comment

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

I would propose to put the ruff configuration to pyproject.toml

rev: v0.1.4
hooks:
# Run the linter.
- id: ruff

Choose a reason for hiding this comment

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

I found this config to be quite helpful: automaticall print the issues, or autofix them if possible.

Suggested change
- id: ruff
- id: ruff
args: [--show-source, --fix]

@@ -1,12 +1,9 @@
repos:

Choose a reason for hiding this comment

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

I would also suggest to add pre-commit-hooks, at least check-yaml is very useful to catch silly errors. See what I am using in my app.

https://github.com/ispg-group/aiidalab-ispg/blob/d4ab6ce6972b1be45a6669007cb343c99ecec90c/.pre-commit-config.yaml#L7

]

ignore = [
"UP009",

Choose a reason for hiding this comment

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

Please comment on each rule what it is and why it is ignored

[lint]
extend-select = [
"UP", # pyupgrade
"D", # pydocstyle

Choose a reason for hiding this comment

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

I would propose to add the isort rule. Also maybe flake8-bugbear which might catch actual bugs.
I am not sure about pydocstyle, given the number of rules we skip below.

See my config (we definitely do not want all the rules I have, just those that are least painful / have most upside)
https://github.com/ispg-group/aiidalab-ispg/blob/main/pyproject.toml

If we enable isort, we should configure aiida, and aiidalab_widgets_base as known-first-party packages so that they are grouped together and separately from others, see
https://github.com/ispg-group/aiidalab-ispg/blob/d4ab6ce6972b1be45a6669007cb343c99ecec90c/pyproject.toml#L49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants