Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 15 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@ repos:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/isort
rev: 5.12.0

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.10

hooks:
- id: isort
args: [ "--profile", "black" ]
name: isort (python)
- repo: https://github.com/psf/black
rev: 23.3.0
- id: ruff
args: ["--fix"]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.12.10
hooks:
- id: black
# Run the linter.
- id: ruff
args: [--fix]
# Run the formatter.
- id: ruff-format

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.4.2
hooks:
Expand All @@ -23,10 +30,3 @@ repos:
args:
- --license-filepath
- LICENSE.md

# Deactivating this for now.
# - repo: https://github.com/pycqa/pylint
# rev: v2.17.0
# hooks:
# - id: pylint
# language_version: python3.9
6 changes: 2 additions & 4 deletions build_notebook_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def _fix_prefix_and_type_in_code_blocks(md_file_path):
updated_block = "\n".join(lines)
content = content.replace(block, updated_block)
block = updated_block
except:
except Exception:
pass

if lines[0] == "```" and "from nemoguardrails" in block:
Expand Down Expand Up @@ -194,9 +194,7 @@ def rename_md_to_readme(start_dir):

# We do some additional post-processing
_remove_code_blocks_with_text(readme_path.absolute(), "# Init:")
_remove_code_blocks_with_text(
readme_path.absolute(), "# Hide from documentation page."
)
_remove_code_blocks_with_text(readme_path.absolute(), "# Hide from documentation page.")

_remove_code_blocks_with_text(
readme_path.absolute(),
Expand Down
10 changes: 3 additions & 7 deletions docs/colang-2/examples/csl.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
sys.path.append(str(pathlib.Path(__file__).parent.parent.parent.parent.resolve()))
print(sys.path)

from utils import compare_interaction_with_test_script
from utils import compare_interaction_with_test_script # noqa: E402

########################################################################################################################
# CORE
Expand Down Expand Up @@ -637,9 +637,7 @@ async def test_repeating_timer():
# USAGE_END: test_repeating_timer
"""

await compare_interaction_with_test_script(
test_script, colang_code, wait_time_s=2.0
)
await compare_interaction_with_test_script(test_script, colang_code, wait_time_s=2.0)


@pytest.mark.asyncio
Expand Down Expand Up @@ -809,9 +807,7 @@ async def test_polling_llm_request_response():
# USAGE_END: test_polling_llm_request_response
"""

await compare_interaction_with_test_script(
test_script, colang_code, llm_responses=['"nine"']
)
await compare_interaction_with_test_script(test_script, colang_code, llm_responses=['"nine"'])


@pytest.mark.asyncio
Expand Down
6 changes: 3 additions & 3 deletions docs/colang-2/examples/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ async def compare_interaction_with_test_script(
)
clean_test_script = cleanup(test_script)
clean_result = cleanup(result)
assert (
clean_test_script == clean_result
), f"\n----\n{clean_result}\n----\n\ndoes not match test script\n\n----\n{clean_test_script}\n----"
assert clean_test_script == clean_result, (
f"\n----\n{clean_result}\n----\n\ndoes not match test script\n\n----\n{clean_test_script}\n----"
)
Loading
Loading