Skip to content

Conversation

@csc-felipe
Copy link
Contributor

@csc-felipe csc-felipe commented Feb 24, 2023

Description

Add pre-commit hooks and checks.

Also added a github action. If it works, and others agree, we could change a bit the github workflows and tox configuration.

Update your environment and enable the git hooks by running:

pip install -Ue .[docs,test,dev]
pre-commit install

Related issues

Type of change

  • New feature (non-breaking change which adds functionality)

Changes Made

  • Added pre-commit configuration
  • fixed raised issues from the checks
  • moved pyspelling configuration to root folder
  • use ruff instead of flake8 and isort

Testing

  • Tests do not apply

Mentions

It might be easier to review by looking at commits individually.

I tried to use the pyupgrade fixes from ruff, but that broke the tests, and I didn't want to investigate. There are a few other tests that might be interesting to consider in the future: e.g. tryceratops, which checks for how to handle exceptions.

@csc-felipe csc-felipe self-assigned this Feb 24, 2023
@csc-felipe csc-felipe changed the title WIP: Add pre-commit hooks Add pre-commit hooks Feb 24, 2023
@csc-felipe csc-felipe changed the title Add pre-commit hooks WIP: Add pre-commit hooks Feb 24, 2023
@csc-felipe
Copy link
Contributor Author

csc-felipe commented Feb 24, 2023

Interesting that the pre-commit action fails because it sorts differently than my system's sort.

In the action sort puts ä after the whole alphabet, while in my system it is considered the same as a.

Base automatically changed from feature/pyproject to devel February 27, 2023 09:04
@csc-felipe
Copy link
Contributor Author

Rebased, and added export LC_ALL=C to make sorting consistent across machines, as suggested by sort's manual:

   *** WARNING *** The locale specified by the environment affects
   sort order.  Set LC_ALL=C to get the traditional sort order that
   uses native byte values.

@csc-felipe
Copy link
Contributor Author

Skip eslint pre-commit run when it is not installed e.g. in the pre-commit github action.

@csc-felipe csc-felipe changed the title WIP: Add pre-commit hooks Add pre-commit hooks Feb 27, 2023
Copy link
Contributor

@blankdots blankdots left a comment

Choose a reason for hiding this comment

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

🤔 i think we should wait on this, this seems to touch a lot of ongoing files. I would rather see functionality added first and standardization last, for the simple reason of that there is too much ongoing work ...

@csc-felipe
Copy link
Contributor Author

You're right. I'll keep it as WIP while we wait

@csc-felipe csc-felipe changed the title Add pre-commit hooks WIP: Add pre-commit hooks Feb 27, 2023
@csc-felipe csc-felipe closed this Mar 23, 2023
@csc-jm csc-jm deleted the feature/pre-commit branch October 22, 2024 11:18
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.

3 participants