Skip to content

Commit 466c6f6

Browse files
committed
fix lint
1 parent 8e77398 commit 466c6f6

File tree

15 files changed

+66
-17
lines changed

15 files changed

+66
-17
lines changed

.agents/skills/weaver-skills-update/SKILL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,8 @@ A script is provided to validate YAML frontmatter and cross-references in all sk
528528
**What it validates**:
529529

530530
- **YAML frontmatter**: Ensures all skills have valid YAML frontmatter between `---` markers
531-
- **Cross-references**: Checks that all relative links to other skills (`../skill-name/`) point to existing skill directories
531+
- **Cross-references**: Checks that all relative links to other skills (`../skill-name/`)
532+
point to existing skill directories
532533

533534
**Example output**:
534535

.agents/skills/weaver-skills-update/scripts/check-frontmatter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"""
66
import os
77
import sys
8+
89
import yaml
910

1011
skills_dir = ".agents/skills"
@@ -16,7 +17,7 @@
1617
if not os.path.isfile(skill_path):
1718
continue
1819

19-
with open(skill_path, 'r') as f:
20+
with open(skill_path, mode="r", encoding="utf-8") as f:
2021
content = f.read()
2122

2223
parts = content.split('---')

.pylintrc

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,27 @@ extension-pkg-whitelist=lxml.etree,
99

1010
# Add files or directories to the blacklist. They should be base names, not
1111
# paths.
12-
ignore=CVS
12+
ignore=
13+
CVS,
14+
env,
15+
.venv,
16+
.env,
17+
.git,
18+
.github,
19+
.vscode,
20+
.idea,
21+
.run,
22+
.tox,
23+
.eggs,
24+
build,
25+
dist,
26+
reports,
27+
node_modules,
28+
1329

1430
# Add files or directories matching the regex patterns to the blacklist. The
1531
# regex matches against base names, not paths.
16-
ignore-patterns=
32+
ignore-patterns=.*\.egg-info,
1733

1834
# Python code to execute, usually for sys.path manipulation such as
1935
# pygtk.require().
@@ -131,7 +147,8 @@ disable=C0111,missing-docstring,
131147
# note: (C0412, ungrouped-imports) is managed via isort tool, ignore false positives
132148

133149
per-file-ignores =
134-
tests/*:R1729
150+
.agents/skills/*/scripts/*:C0103,
151+
tests/*:R1729
135152

136153
# Enable the message, report, category or checker with the given id(s). You can
137154
# either give multiple identifier separated by comma (,) or put this option

CHANGES.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Changes
1212

1313
Changes:
1414
--------
15-
- Set up `Weaver Agent Skills <./.agent/skills>`_ based on
15+
- Set up `Weaver Agent Skills <./.agents/skills>`_ based on
1616
the `Agent Skill Specification <https://agentskills.io/specification>`_
1717
to help AI agents interact with `Weaver` and its API more seamlessly.
1818

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,8 @@ check-lint-only: | mkdir-reports ## check linting of code style
543543
pylint \
544544
--rcfile="$(APP_ROOT)/.pylintrc" \
545545
--reports y \
546-
"$(APP_ROOT)/weaver" "$(APP_ROOT)/tests" \
546+
"$(APP_ROOT)/" \
547+
$(PYLINT_XARGS) \
547548
1> >(tee "$(REPORTS_DIR)/check-lint.txt")'
548549

549550
.PHONY: check-security-only
@@ -629,7 +630,11 @@ check-docstring-only: | mkdir-reports ## check code docstring style and linting
629630
@echo "Running docstring checks..."
630631
@-rm -fr "$(REPORTS_DIR)/check-docstring.txt"
631632
@bash -c '$(CONDA_CMD) \
632-
pydocstyle --explain --config "$(APP_ROOT)/setup.cfg" "$(APP_ROOT)" \
633+
pydocstyle \
634+
--explain \
635+
--config "$(APP_ROOT)/setup.cfg" \
636+
--match-dir "^(node_submodules)" \
637+
"$(APP_ROOT)" \
633638
1> >(tee "$(REPORTS_DIR)/check-docstring.txt")'
634639

635640
.PHONY: check-links-only

docs/_extensions/doc_redirect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def generate_redirects(app):
107107
# create unless it already exists (eg: same directory level, config map is redundant)
108108
if not os.path.exists(redirected_html_file):
109109
# if using a direct call with .html extension, it will still work as if calling the .rst
110-
with open(redirected_html_file, "w") as f:
110+
with open(redirected_html_file, mode="w", encoding="utf-8") as f:
111111
f.write(TEMPLATE % to_path)
112112
if not os.path.exists(redirected_rst_file):
113113
# point to the .rst that would be reach by clicking the literal reference

docs/examples/vault_upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
files = {
1111
"file": (
1212
"desired-name.json",
13-
open(PATH, "r", encoding="utf-8"),
13+
open(PATH, mode="r", encoding="utf-8"), # pylint: disable=R1732
1414
"application/json; charset=UTF-8"
1515
)
1616
}

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
sys.path.insert(0, os.path.abspath(DOC_PRJ_ROOT))
4040

4141
from weaver import __meta__ # isort:skip # noqa: E402 # pylint: disable=C0413
42-
from weaver.wps_restapi.api import get_openapi_json # isort:skip # noqa: E402
42+
from weaver.wps_restapi.api import get_openapi_json # isort:skip # noqa: E402 # pylint: disable=C0413
4343

4444
DOC_PKG_ROOT = os.path.join(DOC_PRJ_ROOT, __meta__.__name__)
4545

@@ -109,7 +109,7 @@ def doc_redirect_include(file_path):
109109
)
110110
if not os.path.isdir(DOC_BLD_ROOT):
111111
os.makedirs(DOC_BLD_ROOT)
112-
with open(api_spec_file, "w") as f:
112+
with open(api_spec_file, mode="w", encoding="utf-8") as f:
113113
json.dump(api_spec_json, f, use_decimal=True)
114114

115115
redoc = [{

setup.cfg

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ skip = *.egg*,build,env,src,venv,reports,node_modules
103103

104104
[bandit]
105105
skips = B101,B320,B410
106-
exclude = *.egg-info,./build,./dist,./env,./tests,test_*
106+
exclude = *.egg-info,./build,./dist,./env,./node_modules,./tests,test_*
107107
targets = .
108108

109109
[flake8]
@@ -134,6 +134,18 @@ wrap-descriptions = 0
134134
wrap-summaries = 120
135135
make-summary-multi-line = True
136136
pre-summary-newline = True
137+
exclude =
138+
./git,
139+
./github,
140+
./.idea,
141+
./.run,
142+
./.vscode,
143+
./build,
144+
./dist,
145+
./env,
146+
./.venv,
147+
./node_modules,
148+
./reports,
137149

138150
[pydocstyle]
139151
add_ignore = D100,D101,D102,D103,D104,D105,D107,D200,D202,D204,D212,D401

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
DOC_REMOVE_PYPI_START = LONG_DESCRIPTION.find(".. remove-pypi-start")
2222
DOC_REMOVE_PYPI_END = LONG_DESCRIPTION.find(".. remove-pypi-end")
2323
if (
24-
DOC_REMOVE_PYPI_START > 0 and # noqa
24+
DOC_REMOVE_PYPI_START > 0 and # noqa # pylint: disable=R1716
2525
DOC_REMOVE_PYPI_END > 0 and
2626
DOC_REMOVE_PYPI_START < DOC_REMOVE_PYPI_END
2727
):
@@ -55,7 +55,7 @@ def _parse_requirements(file_path, requirements, links):
5555
:param requirements: pre-initialized set in which to store extracted package requirements.
5656
:param links: pre-initialized set in which to store extracted link reference requirements.
5757
"""
58-
with open(file_path, "r") as requirements_file:
58+
with open(file_path, mode="r", encoding="utf-8") as requirements_file:
5959
for line in requirements_file:
6060
# ignore empty line, comment line or reference to other requirements file (-r flag)
6161
if not line or line.startswith("#") or line.startswith("-"):

0 commit comments

Comments
 (0)