Skip to content
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

Format the repository and enforce code style in CI #1280

Merged
merged 3 commits into from
Mar 5, 2024

Conversation

xen0n
Copy link
Contributor

@xen0n xen0n commented Mar 4, 2024

No functional change; this is in preparation of more refactoring for better typing within the library.

Context: python/typeshed#11374 -- it turns out it's probably impossible to make pyright happy with the library with stubs alone.

@jdavid
Copy link
Member

jdavid commented Mar 4, 2024

Great, thanks!
Most changes are because of the use of single vs double quotes. But I think this is configurable in ruff, with quote-style = "single" from what I've read. Can you change this to make the PR smaller?

@xen0n
Copy link
Contributor Author

xen0n commented Mar 4, 2024

Great, thanks! Most changes are because of the use of single vs double quotes. But I think this is configurable in ruff, with quote-style = "single" from what I've read. Can you change this to make the PR smaller?

Thank you for the suggestion! I've checked how quote-style = "single" would fare though, it's +1996 -1136 compared with +2929 -2069 in commit 70e7475 -- it seems the quote style is like 50-50 split while the other changes (mostly indentation and line wrapping changes) are equally substantial!

Given double quotes are the default black style, would keeping that style be acceptable in exchange for not having to customize anything?

@jdavid
Copy link
Member

jdavid commented Mar 5, 2024

Hi, I still prefer single quotes, the smaller change the better, this will not obfuscate git blame too much.

@xen0n
Copy link
Contributor Author

xen0n commented Mar 5, 2024

Hi, I still prefer single quotes, the smaller change the better, this will not obfuscate git blame too much.

Okay, will do it!

@jdavid jdavid merged commit 67ea2a3 into libgit2:master Mar 5, 2024
7 checks passed
@xen0n xen0n deleted the ruff-ci branch March 5, 2024 17:13
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request May 19, 2024
# 1.15.0 (2024-05-18)

- Many deprecated features have been removed, see below

- Upgrade to libgit2 v1.8.1

- New `push_options` optional argument in `Repository.push(...)`
  [#1282](libgit2/pygit2#1282)

- New support comparison of `Oid` with text string

- Fix `CheckoutNotify.IGNORED`
  [#1288](libgit2/pygit2#1288)

- Use default error handler when decoding/encoding paths
  [#537](libgit2/pygit2#537)

- Remove setuptools runtime dependency
  [#1281](libgit2/pygit2#1281)

- Coding style with ruff
  [#1280](libgit2/pygit2#1280)

- Add wheels for ppc64le
  [#1279](libgit2/pygit2#1279)

- Fix tests on EPEL8 builds for s390x
  [#1283](libgit2/pygit2#1283)

Deprecations:

- Deprecate `IndexEntry.hex`, use `str(IndexEntry.id)`

Breaking changes:

- Remove deprecated `oid.hex`, use `str(oid)`
- Remove deprecated `object.hex`, use `str(object.id)`
- Remove deprecated `object.oid`, use `object.id`

- Remove deprecated `Repository.add_submodule(...)`, use `Repository.submodules.add(...)`
- Remove deprecated `Repository.lookup_submodule(...)`, use `Repository.submodules[...]`
- Remove deprecated `Repository.init_submodules(...)`, use `Repository.submodules.init(...)`
- Remove deprecated `Repository.update_submodule(...)`, use `Repository.submodules.update(...)`

- Remove deprecated constants `GIT_OBJ_XXX`, use `ObjectType`
- Remove deprecated constants `GIT_REVPARSE_XXX`, use `RevSpecFlag`
- Remove deprecated constants `GIT_REF_XXX`, use `ReferenceType`
- Remove deprecated `ReferenceType.OID`, use instead `ReferenceType.DIRECT`
- Remove deprecated `ReferenceType.LISTALL`, use instead `ReferenceType.ALL`

- Remove deprecated support for passing dicts to repository\'s `merge(...)`,
  `merge_commits(...)` and `merge_trees(...)`. Instead pass `MergeFlag` for `flags`, and
  `MergeFileFlag` for `file_flags`.

- Remove deprecated support for passing a string for the favor argument to repository\'s
  `merge(...)`, `merge_commits(...)` and `merge_trees(...)`. Instead pass `MergeFavor`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants