Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

remove unneeded noqas

Nick Sweeting78148a96f973
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 92cc8ca59..ce52c5e5a 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,32 +1,58 @@
repos:
+ - repo: https://github.com/asottile/yesqa
+ rev: v1.5.0
+ hooks:
+ - id: yesqa
+
+ # - repo: https://github.com/codespell-project/codespell
+ # rev: v2.4.1
+ # hooks:
+ # - id: codespell # See pyproject.toml for args
+ # additional_dependencies:
+ # - tomli
+
+ # - repo: https://github.com/asottile/pyupgrade
+ # rev: v3.19.1
+ # hooks:
+ # - id: pyupgrade
+
+ # - repo: https://github.com/asottile/add-trailing-comma
+ # rev: v3.1.0
+ # hooks:
+ # - id: add-trailing-comma
+
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.2
hooks:
- id: ruff
+ args: ["--fix", "--show-fixes"]
- id: ruff-format
# see pyproject.toml for more details on ruff config
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
+ # check for basic syntax errors in python and data files
+ - id: check-ast
- id: check-toml
- id: check-yaml
- id: check-json
- - id: end-of-file-fixer
- id: check-merge-conflict
- - id: check-illegal-windows-names
- - id: check-case-conflict
- - id: check-added-large-files
- - id: check-shebang-scripts-are-executable
+ # check for bad files and folders
- id: check-symlinks
- id: destroyed-symlinks
- - id: detect-private-key
+ - id: check-case-conflict
+ - id: check-illegal-windows-names
+ - id: check-shebang-scripts-are-executable
- id: mixed-line-ending
- id: fix-byte-order-marker
-
- - repo: https://github.com/codespell-project/codespell
- rev: v2.4.1
- hooks:
- - id: codespell # See pyproject.toml for args
- additional_dependencies:
- - tomli
+ - id: end-of-file-fixer
+ # best practices enforcement
+ - id: detect-private-key
+ # - id: check-docstring-first
+ - id: debug-statements
+ - id: forbid-submodules
+ - id: check-added-large-files
+ args: ["--maxkb=600"]
+ # - id: name-tests-test
+ # args: ["--pytest-test-first"]
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index 00200a989..42b1b460f 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -1267,7 +1267,7 @@ class Agent(Generic[Context]):
test_answer = 'paris'
try:
# dont convert this to async! it *should* block any subsequent llm calls from running
- response = self.llm.invoke([HumanMessage(content=test_prompt)]) # noqa: RUF006
+ response = self.llm.invoke([HumanMessage(content=test_prompt)])
response_text = str(response.content).lower()
if test_answer in response_text:
diff --git a/browser_use/dom/tests/extraction_test.py b/browser_use/dom/tests/extraction_test.py
index 940389ed7..5d3010429 100644
--- a/browser_use/dom/tests/extraction_test.py
+++ b/browser_use/dom/tests/extraction_test.py
@@ -59,7 +59,7 @@ async def test_focus_vs_all_elements():
# browser_binary_path='/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
)
)
- context = BrowserContext(browser=browser, config=config) # noqa: F821
+ context = BrowserContext(browser=browser, config=config)
websites = [
'https://kayak.com/flights',