Commit Graph

24 Commits

Author SHA1 Message Date
Zanie Blue
87c3371eb1
Add write permissions to CI workflow (#118)
See https://github.com/astral-sh/uv-pre-commit/issues/44
2025-03-18 18:07:34 -05:00
Calum Young
6299d2ca23
Update mirror.py to a uv script (#110)
<!--
Thank you for contributing to Ruff! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

From my reading of the [UV
docs](https://docs.astral.sh/uv/guides/scripts/), `mirror.py` would be a
good example of a standalone script. This PR updates `mirror.py` and the
`main.yml` workflow to be a UV script and makes use of UV in the update
process.

## Test Plan

- Update the uv version (currently 0.8.4) to an older version e.g. 0.8.3
in both `pyproject.toml` and `README.md`
- Run `uv run --no-project mirror.py` to check the update process still
works as expected
2024-12-30 10:48:39 -05:00
Jeppe Fihl-Pearson
987f9d7d01
Remove "v" from the Ruff version number in link to release notes (#92)
## Summary

Starting with version 0.5.0 of Ruff, the release/tag name doesn't have a
leading "v". This has broken the link to the release notes that get
added to the release notes for the pre-commit hook.

This fixes it by stripping any "v" from the version number string.

See #91.

## Test Plan

Tested in a bash shell:
```bash
bash-5.2$ TAG_NAME=v0.5.0
bash-5.2$ echo ${TAG_NAME/v}
0.5.0
```

Will otherwise have to be tested on the next Ruff release.
2024-06-28 07:32:17 -04:00
CoderJoshDK
1e9839fabf
fix: correct release notes link (#84)
## Summary

I originally tested this functionality in `uv-pre-commit`. And that is
why when moving it over, I ended up copying the URL for that release. I
am sorry for all the broken code I have introduced. I feel so bad. I am
at least glad I realized before a new `ruff` release came out.
2024-04-05 00:45:38 -04:00
CoderJoshDK
2b6485a44b
fix: auto release on mirror updates (#83)
As mentioned in #82, there are issues with having a workflow triggered
by the work done by a different workflow. To keep the functionality of
the auto release workflow, the two files are being merged into one.

Closes #82
2024-04-03 20:39:03 -05:00
CoderJoshDK
4025f7f381
feat: use uv for package management (#77)
<!--
Thank you for contributing to Ruff! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

`uv` is great. So we should use it where we can. 

The cache had to be removed because the workflow breaks currently.
https://github.com/actions/setup-python/issues/822
When this is solved, caching can be brought back in.

## Test Plan

Ran workflow on my local repo.
2024-04-01 23:05:43 -05:00
CoderJoshDK
53e3b33bd4
feat(workflow): auto release on tag creation (#81)
## Summary

Add a GitHub workflow for creating a new release, automatically, when a
new tag is created.

This solves #78. The code is very similar to the changes added in
https://github.com/astral-sh/uv-pre-commit/pull/6

The primary difference, is that the URL points to ruff and this one
checks for if the tag starts with a `v`, but it is optional. This lets
you change ruff versions to not have a `v` in the future. Although the
`mirror.py` will need to be updated.
Speaking of updates to `mirror.py`, I ran `ruff` on it and updated the
`subprocess` to raise an error on failure.

## Test Plan

Locally tested.
2024-03-30 19:17:08 -04:00
CoderJoshDK
6e85b5cd1f
chore: update information (#76)
## Summary

Changes proposed and introduced through:
https://github.com/astral-sh/uv-pre-commit/pull/1 ; are being fixed and
updated for this repo as well.
2024-03-22 17:46:59 -05:00
Subin Kim
ba4269e9c6
feat: Update pre-commit mirror script (#53)
<!--
Thank you for contributing to Ruff! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->

- `pre-commit-mirror-maker` is not suitable for generating multiple
hooks in single `.pre-commit-hooks.yaml` file.
- So replaced the script and github workflows.

## Test Plan

<!-- How was it tested? -->

- Update `pyproject.toml`'s `ruff==0.0.290` into `ruff==0.0.289`, and
run the script.

```sh
$ python3 mirror.py
...
```
2023-09-26 10:38:22 -05:00
Ali Hamdan
d87e2b0f73
Revert adding toml and jupyter (#45)
See
https://github.com/astral-sh/ruff-pre-commit/issues/44#issuecomment-1629510474
2023-07-10 15:03:43 -04:00
Ali Hamdan
89791c7aee
Add jupyter and toml file types (#44)
## Summary

Add `jupyter` to the file types that ruff pre-commit hook runs on

## Test Plan

This is what pre-commit uses to identify ".ipynb" files. See
dc75a76b7f/identify/extensions.py (L100)
Also black does this
https://github.com/psf/black/blob/main/.pre-commit-hooks.yaml

Fixes #43
2023-07-09 15:37:19 -04:00
Charlie Marsh
0afdbd1c79
Add issue and PR templates (#41) 2023-06-16 22:17:26 -04:00
konstin
56d5440fd2
Add script that updates the version in the README (#39) 2023-05-24 16:06:23 -04:00
Jonathan Plasse
6a0ba18549
Add check to entry (#32) 2023-03-02 10:24:35 -05:00
Mathieu Kniewallner
514931592b
feat: set --force-exclude in pre-commit-mirror command (#23)
https://github.com/charliermarsh/ruff-pre-commit/pull/20 added the flag in pre-commit configuration, but since the source of truth is `pre-commit-mirror` command in the CI workflow, it is replaced by `ruff`, as can be shown in 380e8f2639.
2023-01-21 17:46:31 -05:00
Charlie Marsh
02ec0f1838 Sleep when coming from repository_dispatch 2023-01-18 20:56:59 -05:00
Charlie Marsh
b0a6088322
Set pre-commit options via pre-commit-mirror CLI (#15)
This was done incorrectly in #9 and #10.
2023-01-16 13:11:00 -05:00
Paul Barrett
37d0b1fbf6
Add repository_dispatch trigger for mirror update (#18) 2023-01-16 11:24:33 -05:00
Charlie Marsh
4803a6e6b2
Run sync job every four hours (#14) 2022-12-22 10:48:39 -05:00
Charlie Marsh
48af87ed07 Tweak pre-commit-mirror invocation 2022-10-27 17:17:29 -04:00
Charlie Marsh
c9c9fc5b49
Remove deprecated lint task (#5) 2022-10-27 17:15:16 -04:00
Trevor Gross
301fe68ff7
Deprecate hook name lint; add hook name ruff (#4) 2022-10-27 17:05:41 -04:00
Charlie Marsh
f3c3160746 Disable --fix by default; rename to lint 2022-10-12 11:14:49 -04:00
fsouza
d6a5d784b9
Setup automation with pre-commit-mirror-maker (#1) 2022-10-12 10:02:03 -04:00