mirror of
https://github.com/deepset-ai/haystack.git
synced 2026-05-10 06:12:20 +00:00
chore: make tests run on scripts + fix linting (#10580)
This commit is contained in:
@@ -23,6 +23,7 @@ on:
|
||||
- "test/**/*.py"
|
||||
- "pyproject.toml"
|
||||
- ".github/utils/*.py"
|
||||
- "scripts/*.py"
|
||||
|
||||
env:
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
|
||||
@@ -17,6 +17,7 @@ on:
|
||||
- "test/**/*.py"
|
||||
- "pyproject.toml"
|
||||
- ".github/utils/*.py"
|
||||
- "scripts/*.py"
|
||||
|
||||
jobs:
|
||||
check_if_changed:
|
||||
@@ -40,6 +41,7 @@ jobs:
|
||||
- "test/**/*.py"
|
||||
- "pyproject.toml"
|
||||
- ".github/utils/*.py"
|
||||
- "scripts/*.py"
|
||||
|
||||
trigger-catch-all:
|
||||
name: Tests completed
|
||||
|
||||
@@ -113,7 +113,9 @@ def main() -> int:
|
||||
for path in args.files:
|
||||
with open(path) as f:
|
||||
original = f.read()
|
||||
new = PYTHON_FENCE_RE.sub(lambda m: _format_code_block(m, line_length=args.line_length, path=path), original)
|
||||
new = PYTHON_FENCE_RE.sub(
|
||||
lambda m, path=path: _format_code_block(m, line_length=args.line_length, path=path), original
|
||||
)
|
||||
if new != original:
|
||||
with open(path, "w") as f:
|
||||
f.write(new)
|
||||
|
||||
Reference in New Issue
Block a user