ruff/crates
Peter Hill a90cf9d59c
[ruff] Fix last_tag/commits_since_last_tag for version command (#16686)
## Summary

Since Ruff changed to GitHub releases, tags are no longer annotated and
`git describe` no longer picks them up. Instead, it's necessary to also
search lightweight tags.

This changes fixes the `version` command to give more accurate
`last_tag`/`commits_since_last_tag` information. This only affects
development builds, as this information is not present in releases.

## Test Plan

Testing is a little tricky because this information changes on every
commit. Running manually on current `main` and my branch:

`main`:

```
# cargo run --bin ruff -- version --output-format=text
ruff 0.9.10+2547 (dd2313ab0 2025-03-12)

# cargo run --bin ruff -- version --output-format=json
{
  "version": "0.9.10",
  "commit_info": {
    "short_commit_hash": "dd2313ab0",
    "commit_hash": "dd2313ab0f",
    "commit_date": "2025-03-12",
    "last_tag": "v0.4.10",
    "commits_since_last_tag": 2547
  }
}
```

This PR:

```
# cargo run --bin ruff -- version --output-format=text
ruff 0.9.10+46 (11f39f616 2025-03-12)

# cargo run --bin ruff -- version --output-format=json
{
  "version": "0.9.10",
  "commit_info": {
    "short_commit_hash": "11f39f616",
    "commit_hash": "11f39f6166",
    "commit_date": "2025-03-12",
    "last_tag": "0.9.10",
    "commits_since_last_tag": 46
  }
}
```
2025-03-13 11:59:54 +00:00
..
red_knot [red-knot] Add mypy_primer usage documentation (#16679) 2025-03-12 16:47:10 +01:00
red_knot_project [red-knot] use fixpoint iteration for all cycles (#14029) 2025-03-12 12:41:40 +00:00
red_knot_python_semantic [red-knot] Check gradual equivalence between callable types (#16634) 2025-03-13 08:16:51 +05:30
red_knot_server ruff_db: rename Diagnostic to OldDiagnosticTrait 2025-03-05 08:23:02 -05:00
red_knot_test print MDTEST_TEST_FILTER value in single-quotes (and escaped) (#16548) 2025-03-07 09:04:52 +01:00
red_knot_vendored [red-knot] Add CallableTypeFromFunction special form (#16683) 2025-03-13 07:49:34 +05:30
red_knot_wasm Add OsSystem support to mdtests (#16518) 2025-03-06 10:41:40 +01:00
ruff [ruff] Fix last_tag/commits_since_last_tag for version command (#16686) 2025-03-13 11:59:54 +00:00
ruff_annotate_snippets
ruff_benchmark [red-knot] Handle gradual intersection types in assignability (#16611) 2025-03-11 07:58:56 -07:00
ruff_cache
ruff_db Add OsSystem support to mdtests (#16518) 2025-03-06 10:41:40 +01:00
ruff_dev
ruff_diagnostics
ruff_formatter
ruff_graph
ruff_index
ruff_linter [pep8-naming] Add links to ignore-names options in various rules' documentation (#16557) 2025-03-07 14:49:08 -05:00
ruff_macros
ruff_notebook
ruff_python_ast [red-knot] Understand typing.Callable (#16493) 2025-03-08 03:58:52 +00:00
ruff_python_ast_integration_tests
ruff_python_codegen
ruff_python_formatter Assert that formatted code doesn't introduce any new unsupported syntax errors (#16549) 2025-03-07 09:12:00 +01:00
ruff_python_index
ruff_python_literal
ruff_python_parser Assert that formatted code doesn't introduce any new unsupported syntax errors (#16549) 2025-03-07 09:12:00 +01:00
ruff_python_resolver
ruff_python_semantic
ruff_python_stdlib
ruff_python_trivia
ruff_python_trivia_integration_tests
ruff_server Escape template filenames in glob patterns (#16407) 2025-03-03 09:29:58 -05:00
ruff_source_file
ruff_text_size
ruff_wasm Bump 0.9.10 (#16556) 2025-03-07 09:00:08 -06:00
ruff_workspace Escape template filenames in glob patterns (#16407) 2025-03-03 09:29:58 -05:00