Skip to content

Commit

Permalink
Add more pre-commit hooks (cookiecutter#4266)
Browse files Browse the repository at this point in the history
* Add more hooks from pre-commit-hooks repo

* Add pre-commit hook for prettier

* Format with prettier

* Remove check-docstring-first hook

* Run prettier in the template

* Tweak formatting of dependabot file

* Fix formatting of GitHub files for prettier

* More format fixes of ci.yml
  • Loading branch information
browniebroke authored Apr 15, 2023
1 parent 1783257 commit 0dcc4c4
Show file tree
Hide file tree
Showing 27 changed files with 340 additions and 320 deletions.
10 changes: 5 additions & 5 deletions .github/CONTRIBUTORS-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ accept and merge pull requests.
{%- endfor %}
</table>

*Audrey is also the creator of Cookiecutter. Audrey and Daniel are on
the Cookiecutter core team.*
_Audrey is also the creator of Cookiecutter. Audrey and Daniel are on
the Cookiecutter core team._

## Other Contributors

Expand Down Expand Up @@ -51,6 +51,6 @@ Listed in alphabetical order.
The following haven't provided code directly, but have provided
guidance and advice.

- Jannis Leidel
- Nate Aune
- Barry Morrison
- Jannis Leidel
- Nate Aune
- Barry Morrison
60 changes: 33 additions & 27 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,47 @@ labels: bug

<!-- To assist you best, please include commands that you've run, options you've selected and any relevant logs -->

* Host system configuration:
* Version of cookiecutter CLI (get it with `cookiecutter --version`):
* OS name and version:
- Host system configuration:

On Linux, run
```bash
lsb_release -a 2> /dev/null || cat /etc/redhat-release 2> /dev/null || cat /etc/*-release 2> /dev/null || cat /etc/issue 2> /dev/null
```
- Version of cookiecutter CLI (get it with `cookiecutter --version`):
- OS name and version:

On MacOs, run
```bash
sw_vers
```
On Linux, run

On Windows, via CMD, run
```
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
```
```bash
lsb_release -a 2> /dev/null || cat /etc/redhat-release 2> /dev/null || cat /etc/*-release 2> /dev/null || cat /etc/issue 2> /dev/null
```

On MacOs, run

```bash
# Insert here the OS name and version
```bash
sw_vers
```

```
On Windows, via CMD, run

```
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
```

```bash
# Insert here the OS name and version
* Python version, run `python3 -V`:
* Docker version (if using Docker), run `docker --version`:
* docker-compose version (if using Docker), run `docker-compose --version`:
* ...
* Options selected and/or [replay file](https://cookiecutter.readthedocs.io/en/latest/advanced/replay.html):
On Linux and MacOS: `cat ${HOME}/.cookiecutter_replay/cookiecutter-django.json`
(Please, take care to remove sensitive information)
```json
# Insert here the replay file content
```

- Python version, run `python3 -V`:
- Docker version (if using Docker), run `docker --version`:
- docker-compose version (if using Docker), run `docker-compose --version`:
- ...

- Options selected and/or [replay file](https://cookiecutter.readthedocs.io/en/latest/advanced/replay.html):
On Linux and macOS: `cat ${HOME}/.cookiecutter_replay/cookiecutter-django.json`
(Please, take care to remove sensitive information)

```json
```

<summary>
Logs:
<details>
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/paid-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ about: Ask Core Team members to help you out

Provided your question goes beyond [regular support](https://github.com/cookiecutter/cookiecutter-django/issues/new?template=question.md), and/or the task at hand is of timely/high priority nature use the below information to reach out for contributors directly.

* Daniel Roy Greenfeld, Project Lead ([GitHub](https://github.com/pydanny), [Patreon](https://www.patreon.com/danielroygreenfeld)): expertise in Django and AWS ELB.
- Bruno Alla, Core Developer ([GitHub](https://github.com/sponsors/browniebroke)).

* Nikita Shupeyko, Core Developer ([GitHub](https://github.com/webyneter)): expertise in Python/Django, hands-on DevOps and frontend experience.
- Daniel Roy Greenfeld, Project Lead ([GitHub](https://github.com/pydanny), [Patreon](https://www.patreon.com/danielroygreenfeld)): expertise in Django and AWS ELB.

* Bruno Alla, Core Developer ([GitHub](https://github.com/sponsors/browniebroke)).
- Nikita Shupeyko, Core Developer ([GitHub](https://github.com/webyneter)): expertise in Python/Django, hands-on DevOps and frontend experience.
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!-- Thank you for helping us out: your efforts mean a great deal to the project and the community as a whole! -->


## Description

<!-- What's it you're proposing? -->
Expand Down
9 changes: 6 additions & 3 deletions .github/changelog-template.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{%- for change_type, pulls in grouped_pulls.items() %}
{%- if pulls %}

### {{ change_type }}

{%- for pull_request in pulls %}

- {{ pull_request.title }} ([#{{ pull_request.number }}]({{ pull_request.html_url }}))
{%- endfor -%}
{% endif -%}
{% endfor -%}
{%- endfor -%}
{% endif -%}
{% endfor -%}
12 changes: 9 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ updates:
interval: "daily"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major", "version-update:semver-minor"]
update-types:
- "version-update:semver-major"
- "version-update:semver-minor"
labels:
- "update"

Expand All @@ -39,7 +41,9 @@ updates:
interval: "daily"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major", "version-update:semver-minor"]
update-types:
- "version-update:semver-major"
- "version-update:semver-minor"
labels:
- "update"

Expand All @@ -63,7 +67,9 @@ updates:
interval: "daily"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major", "version-update:semver-minor"]
update-types:
- "version-update:semver-major"
- "version-update:semver-minor"
labels:
- "update"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: [ "master", "main" ]
branches: ["master", "main"]
pull_request:

concurrency:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit-autoupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
# Disables this workflow from running in a repository that is not part of the indicated organization/user
if: github.repository_owner == 'cookiecutter'
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR

runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
# Disables this workflow from running in a repository that is not part of the indicated organization/user
if: github.repository_owner == 'cookiecutter'
permissions:
contents: write # for stefanzweifel/git-auto-commit-action to push code in repo
contents: write # for stefanzweifel/git-auto-commit-action to push code in repo

runs-on: ubuntu-latest
steps:
Expand Down
16 changes: 15 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
exclude: "{{cookiecutter.project_slug}}"
exclude: "{{cookiecutter.project_slug}}|.github/contributors.json|CHANGELOG.md"
default_stages: [commit]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-json
- id: check-toml
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: check-builtin-literals
- id: check-case-conflict
- id: detect-private-key

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.6"
hooks:
- id: prettier
args: ["--tab-width", "2"]

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ accept and merge pull requests.
</tr>
</table>

*Audrey is also the creator of Cookiecutter. Audrey and Daniel are on
the Cookiecutter core team.*
_Audrey is also the creator of Cookiecutter. Audrey and Daniel are on
the Cookiecutter core team._

## Other Contributors

Expand Down Expand Up @@ -1965,6 +1965,6 @@ Listed in alphabetical order.
The following haven't provided code directly, but have provided
guidance and advice.

- Jannis Leidel
- Nate Aune
- Barry Morrison
- Jannis Leidel
- Nate Aune
- Barry Morrison
Loading

0 comments on commit 0dcc4c4

Please sign in to comment.