Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: astral-sh/ruff-pre-commit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.5.6
Choose a base ref
...
head repository: astral-sh/ruff-pre-commit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.8.6
Choose a head ref

Commits on Aug 8, 2024

  1. Mirror: 0.5.7

    charliermarsh committed Aug 8, 2024
    Copy the full SHA
    ac97362 View commit details

Commits on Aug 15, 2024

  1. Mirror: 0.6.0

    charliermarsh committed Aug 15, 2024
    Copy the full SHA
    718fbf5 View commit details
  2. Copy the full SHA
    20d9ac3 View commit details

Commits on Aug 16, 2024

  1. Mirror: 0.6.1

    charliermarsh committed Aug 16, 2024
    Copy the full SHA
    8b5112a View commit details

Commits on Aug 22, 2024

  1. Mirror: 0.6.2

    charliermarsh committed Aug 22, 2024
    Copy the full SHA
    24d039e View commit details

Commits on Aug 29, 2024

  1. Mirror: 0.6.3

    charliermarsh committed Aug 29, 2024
    Copy the full SHA
    f1ebc57 View commit details

Commits on Sep 5, 2024

  1. Mirror: 0.6.4

    charliermarsh committed Sep 5, 2024
    Copy the full SHA
    03d82ba View commit details

Commits on Sep 13, 2024

  1. Mirror: 0.6.5

    charliermarsh committed Sep 13, 2024
    Copy the full SHA
    79f422b View commit details

Commits on Sep 20, 2024

  1. Mirror: 0.6.6

    charliermarsh committed Sep 20, 2024
    Copy the full SHA
    ef9b095 View commit details

Commits on Sep 21, 2024

  1. Mirror: 0.6.7

    charliermarsh committed Sep 21, 2024
    Copy the full SHA
    9f089bd View commit details

Commits on Sep 26, 2024

  1. Mirror: 0.6.8

    charliermarsh committed Sep 26, 2024
    Copy the full SHA
    cc915bb View commit details

Commits on Sep 27, 2024

  1. Update readme config examples to work with pre-commit >= 3 (#99)

    Co-authored-by: Ruwen Frick <ruwen.frick@ost.ch>
    ruwfr and ruwfr-ost authored Sep 27, 2024
    Copy the full SHA
    46cdcac View commit details

Commits on Oct 4, 2024

  1. Mirror: 0.6.9

    charliermarsh committed Oct 4, 2024
    Copy the full SHA
    75b9881 View commit details

Commits on Oct 17, 2024

  1. Mirror: 0.7.0

    charliermarsh committed Oct 17, 2024
    Copy the full SHA
    8983acb View commit details

Commits on Oct 24, 2024

  1. Mirror: 0.7.1

    charliermarsh committed Oct 24, 2024
    Copy the full SHA
    4edcbde View commit details

Commits on Nov 1, 2024

  1. Mirror: 0.7.2

    charliermarsh committed Nov 1, 2024
    Copy the full SHA
    52c175d View commit details

Commits on Nov 8, 2024

  1. Mirror: 0.7.3

    charliermarsh committed Nov 8, 2024
    Copy the full SHA
    6a19e69 View commit details

Commits on Nov 15, 2024

  1. Mirror: 0.7.4

    charliermarsh committed Nov 15, 2024
    Copy the full SHA
    cafecb2 View commit details

Commits on Nov 22, 2024

  1. Mirror: 0.8.0

    charliermarsh committed Nov 22, 2024
    Copy the full SHA
    0710b94 View commit details

Commits on Nov 29, 2024

  1. Mirror: 0.8.1

    charliermarsh committed Nov 29, 2024
    Copy the full SHA
    859e42a View commit details

Commits on Dec 5, 2024

  1. Mirror: 0.8.2

    charliermarsh committed Dec 5, 2024
    Copy the full SHA
    8b76f04 View commit details

Commits on Dec 12, 2024

  1. Mirror: 0.8.3

    charliermarsh committed Dec 12, 2024
    Copy the full SHA
    fc6ef5d View commit details

Commits on Dec 19, 2024

  1. Mirror: 0.8.4

    charliermarsh committed Dec 19, 2024
    Copy the full SHA
    f0b5944 View commit details

Commits on Dec 30, 2024

  1. 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
    calumy authored Dec 30, 2024
    Copy the full SHA
    6299d2c View commit details

Commits on Jan 2, 2025

  1. Mirror: 0.8.5

    charliermarsh committed Jan 2, 2025
    Copy the full SHA
    751b8b5 View commit details

Commits on Jan 4, 2025

  1. Mirror: 0.8.6

    charliermarsh committed Jan 4, 2025
    Copy the full SHA
    89c421d View commit details
Showing with 27 additions and 38 deletions.
  1. +3 −9 .github/workflows/main.yml
  2. +2 −2 .pre-commit-hooks.yaml
  3. +12 −9 README.md
  4. +9 −0 mirror.py
  5. +1 −7 pyproject.toml
  6. +0 −11 requirements-dev.txt
12 changes: 3 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -16,21 +16,15 @@ jobs:

- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: download uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- run: uv pip install --system -r requirements-dev.txt
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: set git config
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- run: python mirror.py
- run: uv run --no-project mirror.py

- name: check for unpushed commits
id: check_unpushed
4 changes: 2 additions & 2 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
description: "Run 'ruff' for extremely fast Python linting"
entry: ruff check --force-exclude
language: python
types_or: [python, pyi]
types_or: [python, pyi, jupyter]
args: []
require_serial: true
additional_dependencies: []
@@ -14,7 +14,7 @@
description: "Run 'ruff format' for extremely fast Python formatting"
entry: ruff format --force-exclude
language: python
types_or: [python, pyi]
types_or: [python, pyi, jupyter]
args: []
require_serial: true
additional_dependencies: []
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# ruff-pre-commit

[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![image](https://img.shields.io/pypi/v/ruff/0.5.6.svg)](https://pypi.python.org/pypi/ruff)
[![image](https://img.shields.io/pypi/l/ruff/0.5.6.svg)](https://pypi.python.org/pypi/ruff)
[![image](https://img.shields.io/pypi/pyversions/ruff/0.5.6.svg)](https://pypi.python.org/pypi/ruff)
[![image](https://img.shields.io/pypi/v/ruff/0.8.6.svg)](https://pypi.python.org/pypi/ruff)
[![image](https://img.shields.io/pypi/l/ruff/0.8.6.svg)](https://pypi.python.org/pypi/ruff)
[![image](https://img.shields.io/pypi/pyversions/ruff/0.8.6.svg)](https://pypi.python.org/pypi/ruff)
[![Actions status](https://github.com/astral-sh/ruff-pre-commit/workflows/main/badge.svg)](https://github.com/astral-sh/ruff-pre-commit/actions)

A [pre-commit](https://pre-commit.com/) hook for [Ruff](https://github.com/astral-sh/ruff).
@@ -17,9 +17,10 @@ To run Ruff's [linter](https://docs.astral.sh/ruff/linter) and [formatter](https
(available as of Ruff v0.0.289) via pre-commit, add the following to your `.pre-commit-config.yaml`:

```yaml
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.6
rev: v0.8.6
hooks:
# Run the linter.
- id: ruff
@@ -30,9 +31,10 @@ To run Ruff's [linter](https://docs.astral.sh/ruff/linter) and [formatter](https
To enable lint fixes, add the `--fix` argument to the lint hook:

```yaml
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.6
rev: v0.8.6
hooks:
# Run the linter.
- id: ruff
@@ -41,20 +43,21 @@ To enable lint fixes, add the `--fix` argument to the lint hook:
- id: ruff-format
```

To run the hooks over Jupyter Notebooks too, add `jupyter` to the list of allowed filetypes:
To avoid running on Jupyter Notebooks, remove `jupyter` from the list of allowed filetypes:

```yaml
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.6
rev: v0.8.6
hooks:
# Run the linter.
- id: ruff
types_or: [ python, pyi, jupyter ]
types_or: [ python, pyi ]
args: [ --fix ]
# Run the formatter.
- id: ruff-format
types_or: [ python, pyi, jupyter ]
types_or: [ python, pyi ]
```

When running with `--fix`, Ruff's lint hook should be placed _before_ Ruff's formatter hook, and
9 changes: 9 additions & 0 deletions mirror.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "packaging==23.1",
# "urllib3==2.0.5",
# ]
# ///
"""Update ruff-pre-commit to the latest version of ruff."""

import re
import subprocess
import tomllib
8 changes: 1 addition & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -2,11 +2,5 @@
name = "ruff-pre-commit"
version = "0.0.0"
dependencies = [
"ruff==0.5.6",
]

[project.optional-dependencies]
dev = [
"packaging~=23.1",
"urllib3>=2.0.5,<3.0.0",
"ruff==0.8.6",
]
11 changes: 0 additions & 11 deletions requirements-dev.txt

This file was deleted.