Skip to content
Closed
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repos:
name: Validating CITATION.cff using 'cffconvert'

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 6.0.1
hooks:
- id: isort
name: Sorting Python import lines using 'isort'
Expand All @@ -17,26 +17,26 @@ repos:
- "--diff"

- repo: https://github.com/regebro/pyroma
rev: "4.2"
rev: "5.0"
hooks:
- id: pyroma
name: Assessing the package metadata using 'pyroma'

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.278
rev: v0.12.9
hooks:
- id: ruff
name: Linting using 'ruff'

- repo: https://github.com/PyCQA/prospector
rev: 1.10.2
rev: v1.17.3
hooks:
- id: prospector
name: Linting the code base using 'prospector'
args: ["--profile-path", ".prospector.yml"]

- repo: https://github.com/tcort/markdown-link-check
rev: bde6fd2675901c55f8a356a67475257d44af51ae # 3.11.2
rev: v3.13.7
hooks:
- id: markdown-link-check
args: [-q]
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,14 @@ testpaths = [

[tool.ruff]
line-length = 120

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

[tool.ruff.lint]
select = ["E", "F", "W", "C901", "Q"]

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

[tool.ruff.flake8-quotes]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
inline-quotes = "double"
2 changes: 1 addition & 1 deletion src/cffconvert/cli/rawify_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def rawify_url(url):
# Proceed with making the call without authenticating -- stricter rate limits apply
pass
else:
headers.update({"Authorization": f"Bearer { token }"})
headers.update({"Authorization": f"Bearer {token}"})

try:
response = requests.get(repos_api, headers=headers, timeout=10)
Expand Down
2 changes: 1 addition & 1 deletion src/cffconvert/cli/read_from_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def read_from_url(url):
# Proceed with making the call without authenticating -- stricter rate limits apply
pass
else:
headers.update({"Authorization": f"Bearer { token }"})
headers.update({"Authorization": f"Bearer {token}"})
response = requests.get(url_raw, headers=headers, timeout=30)
if response.ok:
return response.text
Expand Down
10 changes: 5 additions & 5 deletions src/cffconvert/lib/cff_1_x_x/authors/ris.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,19 @@ def __init__(self, author):
}

def _from_alias(self):
return f"AU - { self._author.get('alias') }\n"
return f"AU - {self._author.get('alias')}\n"

def _from_given_and_last(self):
return f"AU - { self._get_full_last_name() }, { self._author.get('given-names') }\n"
return f"AU - {self._get_full_last_name()}, {self._author.get('given-names')}\n"

def _from_given(self):
return f"AU - { self._author.get('given-names') }\n"
return f"AU - {self._author.get('given-names')}\n"

def _from_last(self):
return f"AU - { self._get_full_last_name() }\n"
return f"AU - {self._get_full_last_name()}\n"

def _from_name(self):
return f"AU - { self._author.get('name') }\n"
return f"AU - {self._author.get('name')}\n"

def as_string(self):
key = self._get_key()
Expand Down
10 changes: 5 additions & 5 deletions src/cffconvert/lib/cff_1_x_x/urls/bibtex.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@ def __init__(self, cffobj):
def _from_identifiers_url(self):
urls = self._get_urls_from_identifiers()
if len(urls) > 0:
return f"url = { '{' + urls[0].get('value') + '}' }"
return f"url = {{{urls[0].get('value')}}}"
return None

def _from_repository(self):
return f"url = { '{' + self._cffobj.get('repository') + '}' }"
return f"url = {{{self._cffobj.get('repository')}}}"

def _from_repository_artifact(self):
return f"url = { '{' + self._cffobj.get('repository-artifact') + '}' }"
return f"url = {{{self._cffobj.get('repository-artifact')}}}"

def _from_repository_code(self):
return f"url = { '{' + self._cffobj.get('repository-code') + '}' }"
return f"url = {{{self._cffobj.get('repository-code')}}}"

@staticmethod
def _from_thin_air():
return None

def _from_url(self):
return f"url = { '{' + self._cffobj.get('url') + '}' }"
return f"url = {{{self._cffobj.get('url')}}}"

def as_string(self):
key = "".join([
Expand Down
10 changes: 5 additions & 5 deletions src/cffconvert/lib/cff_1_x_x/urls/ris.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@ def __init__(self, cffobj):
def _from_identifiers_url(self):
urls = self._get_urls_from_identifiers()
if len(urls) > 0:
return f"UR - { urls[0].get('value') }\n"
return f"UR - {urls[0].get('value')}\n"
return None

def _from_repository(self):
return f"UR - { self._cffobj.get('repository') }\n"
return f"UR - {self._cffobj.get('repository')}\n"

def _from_repository_artifact(self):
return f"UR - { self._cffobj.get('repository-artifact') }\n"
return f"UR - {self._cffobj.get('repository-artifact')}\n"

def _from_repository_code(self):
return f"UR - { self._cffobj.get('repository-code') }\n"
return f"UR - {self._cffobj.get('repository-code')}\n"

@staticmethod
def _from_thin_air():
return None

def _from_url(self):
return f"UR - { self._cffobj.get('url') }\n"
return f"UR - {self._cffobj.get('url')}\n"

def as_string(self):
key = "".join([
Expand Down
Loading