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

Use ruff to check code format intead of black #790

Merged
merged 1 commit into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ VCR.py 📼
###########


|PyPI| |Python versions| |Build Status| |CodeCov| |Gitter| |CodeStyleBlack|
|PyPI| |Python versions| |Build Status| |CodeCov| |Gitter|

----

Expand Down Expand Up @@ -70,6 +70,3 @@ more details
.. |CodeCov| image:: https://codecov.io/gh/kevin1024/vcrpy/branch/master/graph/badge.svg
:target: https://codecov.io/gh/kevin1024/vcrpy
:alt: Code Coverage Status
.. |CodeStyleBlack| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code Style: black
9 changes: 2 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
[tool.black]
line-length=110

[tool.codespell]
skip = '.git,*.pdf,*.svg,.tox'
ignore-regex = "\\\\[fnrstv]"
#
# ignore-words-list = ''

[tool.pytest.ini_options]
markers = [
"online",
]
markers = ["online"]

[tool.ruff]
select = [
Expand All @@ -30,4 +25,4 @@ line-length = 110
target-version = "py38"

[tool.ruff.isort]
known-first-party = [ "vcr" ]
known-first-party = ["vcr"]
4 changes: 1 addition & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ commands =
[testenv:lint]
skipsdist = True
commands =
black --version
black --check --diff .
ruff --version
ruff format --check .
ruff check .
deps =
black
ruff
basepython = python3.10

Expand Down
12 changes: 8 additions & 4 deletions vcr/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,14 @@ def _httplib2(self):

yield cpool, "HTTPConnectionWithTimeout", VCRHTTPConnectionWithTimeout
yield cpool, "HTTPSConnectionWithTimeout", VCRHTTPSConnectionWithTimeout
yield cpool, "SCHEME_TO_CONNECTION", {
"http": VCRHTTPConnectionWithTimeout,
"https": VCRHTTPSConnectionWithTimeout,
}
yield (
cpool,
"SCHEME_TO_CONNECTION",
{
"http": VCRHTTPConnectionWithTimeout,
"https": VCRHTTPSConnectionWithTimeout,
},
)

@_build_patchers_from_mock_triples_decorator
def _tornado(self):
Expand Down