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 contributing formatting part #633

Open
martinfleis opened this issue Jun 27, 2024 · 6 comments · May be fixed by #683
Open

Update contributing formatting part #633

martinfleis opened this issue Jun 27, 2024 · 6 comments · May be fixed by #683

Comments

@martinfleis
Copy link
Member

We should include ruff and pre-commit there.

@speco29
Copy link

speco29 commented Feb 11, 2025

We should include ruff and pre-commit there.

hello @martinfleis , I would like to work on this issue.
Can you tell me what file are you talking about here specifically?

@martinfleis
Copy link
Member Author

It is this one https://github.com/pysal/momepy/blob/main/docs/contributing.rst but do you know what to change?

@speco29
Copy link

speco29 commented Feb 11, 2025

By the issue, I got that we had to add ruff and pre-commit there, but more insight would be very helpful.

@speco29
Copy link

speco29 commented Feb 12, 2025

I think firstly we would have to create a .pre-commit-config.yaml file where we will host the below snippet:

repos:
  - repo: https://github.com/pre-commit/mirrors-ruff
    rev: v0.0.1 # You can specify the version you want to use
    hooks:
      - id: ruff

then we can update our Contributing file with following:

Contributing
============

Setting Up Your Environment
---------------------------

To ensure a consistent code style and catch potential issues, we use `ruff` and `pre-commit` in this project.

1. Install `ruff` and `pre-commit`:

   .. code-block:: bash

      pip install ruff pre-commit

2. Set up `pre-commit` hooks:

   .. code-block:: bash

      pre-commit install

   This will install the `pre-commit` hooks defined in the `.pre-commit-config.yaml` file.

3. Running `ruff` manually:

   You can run `ruff` manually to check your code for style issues:

   .. code-block:: bash

      ruff .

4. Running `pre-commit` hooks manually:

   You can also run all `pre-commit` hooks manually:

   .. code-block:: bash

      pre-commit run --all-files

By following these steps, you'll ensure that your code adheres to the project's style guidelines and passes all pre-commit checks before committing changes.

let me know if I'm right;)

@speco29
Copy link

speco29 commented Feb 15, 2025

Should I make PR about it?

@martinfleis
Copy link
Member Author

I think firstly we would have to create a .pre-commit-config.yaml

Please check the existing code base first. We do have a pre commit.

The rest is roughly ok.

speco29 added a commit to speco29/momepy that referenced this issue Feb 15, 2025
Added the ruff and pre-commit in ontributing.
@speco29 speco29 linked a pull request Feb 15, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants