8000 Remove deprecated pre-commit script and adjust doc by ewjoachim · Pull Request #6455 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Remove deprecated pre-commit script and adjust doc #6455

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

Merged
merged 3 commits into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
36 changes: 29 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,23 @@ it takes a bit longer. For more details, read below.

## Preparing the environment

To reformat the code, check for common problems, and
run the tests, it can be useful to prepare a
[virtual environment](https://docs.python.org/3/tutorial/venv.html) and install
certain libraries typeshed uses to check stub files.
### Code away!

Follow platform-specific instructions below. Following that, to automatically
check your code before committing, you can copy the file `pre-commit` to
`.git/hooks/pre-commit`.
Typeshed runs continuous integration (CI) on all pull requests. This will
automatically fix formatting (using `black`, `isort`) and run tests.
It means you can ignore all local setup on your side, focus on the
code and rely on the CI to fix everything, or point you to the places that
need fixing.

### ... Or create a local development environment

If you prefer to run the tests & formatting locally, it's
possible too. Follow platform-specific instructions below.

Whichever platform you're using, you will need a
virtual environment. If you're not familiar with what it is and how it works,
please refer to this
[documentation](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/).

### Linux/Mac OS

Expand Down Expand Up @@ -74,6 +83,19 @@ following commands from a Windows terminal:
(.venv3) > python -m pip install -r requirements-tests-py3.txt
```

## Code formatting

The code is formatted by `black` and `isort`.

The repository is equipped with a [`pre-commit.ci`](https://pre-commit.ci/)
configuration file. This means that you don't *need* to do anything yourself to
run the code formatters. When you push a commit, a bot will run those for you
right away and add a commit to your PR. Neat, no?

That being said, if you *want* to run the checks locally when you commit, you
can install the hooks: please refer to the [pre-commit](https://pre-commit.com/)
documentation.

## Where to make changes

### Standard library stubs
Expand Down
28 changes: 0 additions & 28 deletions pre-commit

This file was deleted.

0