Skip to content
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
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Code formatting
uses: astral-sh/ruff-action@v3
- uses: actions/setup-python@v3
with:
args: "format --check --diff"
python-version: ${{ env.PY_VERSION_BUILD }}
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

pypa-build:
name: PyPA build
Expand Down Expand Up @@ -79,8 +79,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install '.[devel,test]'
- name: Lint with ruff
uses: astral-sh/ruff-action@v3
- name: Test with pytest
run: |
python -m pytest
Expand Down
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.13.2
rev: v0.15.0
hooks:
# Run the linter.
- id: ruff-check
args: [ --fix ]
# Run the formatter.
- id: ruff-format
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ build-backend = "setuptools.build_meta"

[project.optional-dependencies]
devel = [
"ruff",
"pre-commit",
]
test = [
Expand Down
16 changes: 6 additions & 10 deletions src/access/config/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,12 @@ def _float_to_str(value: float, token: Token) -> str:
"integer": lambda value, token: value,
"float": lambda value, token: _float_to_str(value, token),
"double": lambda value, token: _float_to_str(value, token),
"complex": lambda value, token: "("
+ _float_to_str(value.real, token)
+ ", "
+ _float_to_str(value.imag, token)
+ ")",
"double_complex": lambda value, token: "("
+ _float_to_str(value.real, token)
+ ", "
+ _float_to_str(value.imag, token)
+ ")",
"complex": lambda value, token: (
"(" + _float_to_str(value.real, token) + ", " + _float_to_str(value.imag, token) + ")"
),
"double_complex": lambda value, token: (
"(" + _float_to_str(value.real, token) + ", " + _float_to_str(value.imag, token) + ")"
),
"identifier": lambda value, token: value,
"string": lambda value, token: token[0] + value + token[-1],
"path": lambda value, token: str(value),
Expand Down
Loading