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
4 changes: 1 addition & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ jobs:
enable-cache: true
activate-environment: true
- name: Lint with Ruff
run: |
uv tool install ruff
uv run ruff check --output-format=github .
run: uvx ruff check --output-format=github .
continue-on-error: false

- name: Install dependencies
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ target-version = "py39"
# "UP",
# "W",
#]
# Pin the rule set explicitly - ruff 0.16 widened its defaults from 2 to 38 rule
# prefixes, so relying on the defaults makes lint results depend on the ruff version.
select = [
"E4",
"E7",
"E9",
"F",
"I",
]
ignore = [
"PLR0915",
"PLR0912",
Expand Down
5 changes: 5 additions & 0 deletions src/pyff/builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,11 @@ def _nop(x):
resource_name = m.group(2)
out = output_file
data = req.t

# clean unused namespaces - the working document isn't always XML (eg discojson* produce JSON)
if isinstance(data, (etree._Element, etree._ElementTree)):
etree.cleanup_namespaces(data)

if not req.args.get('raw'):
data = dumptree(req.t, pretty_print=req.args.get('pretty_print'))

Expand Down
Loading