The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
ci: add lefthook git hook manager to dev dependencies
Maciej Lisiewskif6258f6cfbcb
diff --git a/lefthook.yml b/lefthook.ymlnew file mode 100644index 00000000000..f13dbe4ae51--- /dev/null+++ b/lefthook.yml@@ -0,0 +1,5 @@+pre-commit:+ jobs:+ - name: lint python+ glob: "*.py" # glob filter+ run: ruff check --config ./ruff.strict.toml {staged_files}diff --git a/package-lock.json b/package-lock.jsonindex 4ba3299ddea..cb5bd1433f9 100644--- a/package-lock.json+++ b/package-lock.json@@ -26,6 +26,7 @@"eslint-plugin-react-hooks": "7.1.1","eslint-plugin-unused-imports": "4.4.1","globals": "17.7.0",+ "lefthook": "^2.1.14","typescript-eslint": "8.64.0"},"engines": {@@ -12897,6 +12898,169 @@"integrity": "sha512-0/BnGCCfyUMkBpeDgWihanIAF9JmZhHBgUhEqzvf+adhNGLoP6TaiI5oF8oyb3I45P+PcnrqihSf01M0l0G5+Q==","license": "MIT"},+ "node_modules/lefthook": {+ "version": "2.1.14",+ "resolved": "https://registry.npmjs.org/lefthook/-/lefthook-2.1.14.tgz",+ "integrity": "sha512-Y9TL1dmpRlIdSp73SJ6bb+xAZ4s2SinGTK3pgC9PRWMSjMr2iOfowPGnlSOfAo5fu6S5rdiItsQDxeLEWCGk4g==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "bin": {+ "lefthook": "bin/index.js"+ },+ "optionalDependencies": {+ "lefthook-darwin-arm64": "2.1.14",+ "lefthook-darwin-x64": "2.1.14",+ "lefthook-freebsd-arm64": "2.1.14",+ "lefthook-freebsd-x64": "2.1.14",+ "lefthook-linux-arm64": "2.1.14",+ "lefthook-linux-x64": "2.1.14",+ "lefthook-openbsd-arm64": "2.1.14",+ "lefthook-openbsd-x64": "2.1.14",+ "lefthook-windows-arm64": "2.1.14",+ "lefthook-windows-x64": "2.1.14"+ }+ },+ "node_modules/lefthook-darwin-arm64": {+ "version": "2.1.14",+ "resolved": "https://registry.npmjs.org/lefthook-darwin-arm64/-/lefthook-darwin-arm64-2.1.14.tgz",+ "integrity": "sha512-VMUAqY81+8ph7Mc0iROd3JWqj2sOuK7SYDyd8ZgzYVKChCt+Nnz8ehd4gUwprJy7QI28IFSUh1M3wnIRiYh+fA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ]+ },+ "node_modules/lefthook-darwin-x64": {+ "version": "2.1.14",+ "resolved": "https://registry.npmjs.org/lefthook-darwin-x64/-/lefthook-darwin-x64-2.1.14.tgz",+ "integrity": "sha512-uSmjcPRU+yB+D6vk+u6WJDnyHlB+XIv1QZw97N2+qNGG2bNSLH/7MuJ6puCdJv+lVPBEO5wBjE3JIbaEzPOQCw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ]+ },+ "node_modules/lefthook-freebsd-arm64": {+ "version": "2.1.14",+ "resolved": "https://registry.npmjs.org/lefthook-freebsd-arm64/-/lefthook-freebsd-arm64-2.1.14.tgz",+ "integrity": "sha512-po/pmjbp/7BjE9RFfeDnh+CeNsA0d+utppOYKB425I7mgI1GcmT8GAZ9DDut4DIutNjVqKL/lzrj+F87Gm40Rg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ]+ },+ "node_modules/lefthook-freebsd-x64": {+ "version": "2.1.14",+ "resolved": "https://registry.npmjs.org/lefthook-freebsd-x64/-/lefthook-freebsd-x64-2.1.14.tgz",+ "integrity": "sha512-+KiXiFjJf7YdHUYjzhDsklcA5bAFZN+pNcz/NbBftrhVTwzNALNoK+SYEKt+9QJsrzL6tpDWmHHFpeLGp+8t8w==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ]+ },+ "node_modules/lefthook-linux-arm64": {+ "version": "2.1.14",+ "resolved": "https://registry.npmjs.org/lefthook-linux-arm64/-/lefthook-linux-arm64-2.1.14.tgz",+ "integrity": "sha512-bjeJB16ftJaPWGTedssh8ZrqRy1ACfQuTV7a0O3NU1FoIsJtfHOm0o0mV4cPf4q+ZCVCwq1Xf2I11qUpuJFV4Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/lefthook-linux-x64": {+ "version": "2.1.14",+ "resolved": "https://registry.npmjs.org/lefthook-linux-x64/-/lefthook-linux-x64-2.1.14.tgz",+ "integrity": "sha512-gYExzjU2w3uKrP1MklbHENS1cXUdCQRIiEJkykI7q4RjhIHi+mQEUAZLxZw93a6jE2pNWaO0me5tB8EbEt4/GQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/lefthook-openbsd-arm64": {+ "version": "2.1.14",+ "resolved": "https://registry.npmjs.org/lefthook-openbsd-arm64/-/lefthook-openbsd-arm64-2.1.14.tgz",+ "integrity": "sha512-MCW76gTlEMBF3Ds8O63UTxjaSguha/5zT0U3Vr719I1sXueSpttfRmm/5YfIB4MygB116yA/Vi+DsizT/X0kcg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ]+ },+ "node_modules/lefthook-openbsd-x64": {+ "version": "2.1.14",+ "resolved": "https://registry.npmjs.org/lefthook-openbsd-x64/-/lefthook-openbsd-x64-2.1.14.tgz",+ "integrity": "sha512-salAc1PAhLI6xrB9pth5UxALQlTOGvZAfaAvgFwixhkdu8D//uW8zS3faFq31ktd1bDAy5wDI8p9yg+fF5+2uA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ]+ },+ "node_modules/lefthook-windows-arm64": {+ "version": "2.1.14",+ "resolved": "https://registry.npmjs.org/lefthook-windows-arm64/-/lefthook-windows-arm64-2.1.14.tgz",+ "integrity": "sha512-q3JC6lBrYLzkhXEhfnmFxJF47gSd5JeDweH3aNrHoLGX/KkRiOrk9RSyoRwSuGq03EYxSkJhl1FLj2GUxF7VqQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/lefthook-windows-x64": {+ "version": "2.1.14",+ "resolved": "https://registry.npmjs.org/lefthook-windows-x64/-/lefthook-windows-x64-2.1.14.tgz",+ "integrity": "sha512-WwIxdwW1lDAaJUU3ETcKlCtdqluGr3Cy+LjKvP4QIQnFf0FEXL78THstIkZ6k6qhfUn7/WvyqSIf0cbTAKw2nQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },"node_modules/leva": {"version": "0.10.1","resolved": "https://registry.npmjs.org/leva/-/leva-0.10.1.tgz",diff --git a/package.json b/package.jsonindex 2170d11554b..5b2a14db791 100644--- a/package.json+++ b/package.json@@ -23,7 +23,8 @@"audit:fix:web": "npm audit fix --workspace web","audit:fix:tui": "npm audit fix --workspace ui-tui","check": "npm run --ws check",- "fix": "npm run --ws fix"+ "fix": "npm run --ws fix",+ "prepare": "lefthook install"},"repository": {"type": "git",@@ -40,6 +41,7 @@"eslint-plugin-react-hooks": "7.1.1","eslint-plugin-unused-imports": "4.4.1","globals": "17.7.0",+ "lefthook": "^2.1.14","typescript-eslint": "8.64.0"},"overrides": {@@ -73,7 +75,8 @@"[email protected]": true,"[email protected]": true,"[email protected]": true,- "[email protected]": true+ "[email protected]": true,+ "[email protected]": true},"dependencies": {"js-yaml": "4.3.1",diff --git a/ruff.strict.toml b/ruff.strict.tomlnew file mode 100644index 00000000000..6b70b69f199--- /dev/null+++ b/ruff.strict.toml@@ -0,0 +1,460 @@+exclude = [+ ".bzr",+ ".git",+ ".pyenv",+ ".pytest_cache",+ ".pytype",+ ".ruff_cache",+ ".venv",+ ".vscode",+ "__pypackages__",+]++# Same as Black.+line-length = 88+indent-width = 4++# Assume Python 3.14+target-version = "py314"+++# Allow fix for all enabled rules (when `--fix`) is provided.+fixable = ["ALL"]+unfixable = []++# Allow unused variables when underscore-prefixed.+dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"++[format]+# Like Black, use double quotes for strings.+quote-style = "double"++# Like Black, indent with spaces, rather than tabs.+indent-style = "space"++# Like Black, respect magic trailing commas.+skip-magic-trailing-comma = false++# Like Black, automatically detect the appropriate line ending.+line-ending = "auto"++[lint]+select = [+ "YTT101",+ "YTT102",+ "YTT103",+ "YTT201",+ "YTT202",+ "YTT203",+ "YTT204",+ "YTT301",+ "YTT302",+ "YTT303",+ "ASYNC100",+ "ASYNC105",+ "ASYNC115",+ "ASYNC116",+ "ASYNC210",+ # "ASYNC220",+ # "ASYNC221",+ "ASYNC222",+ # "ASYNC230",+ # "ASYNC251",+ # "S102",+ # "S110",+ # "S112",+ # "BLE001",+ "B002",+ "B003",+ # "B004",+ "B005",+ "B006",+ # "B008",+ "B009",+ "B010",+ "B012",+ "B013",+ "B014",+ "B015",+ "B016",+ # "B017",+ # "B018",+ "B019",+ "B020",+ "B021",+ # "B022",+ # "B023",+ "B025",+ # "B026",+ "B029",+ # "B030",+ "B031",+ "B032",+ "B033",+ "B035",+ # "B039",+ "C400",+ # "C401",+ # "C402",+ "C403",+ "C404",+ "C405",+ # "C406",+ # "C408",+ # "C409",+ "C410",+ "C411",+ # "C413",+ "C414",+ "C415",+ # "C417",+ "C418",+ # "C419",+ # "C901",+ # "DTZ001",+ "DTZ002",+ # "DTZ003",+ "DTZ004",+ # "DTZ005",+ # "DTZ006",+ # "DTZ007",+ # "DTZ011",+ "DTZ012",+ "DTZ901",+ "T100",+ # "EXE001",+ # "EXE002",+ "EXE004",+ "EXE005",+ "FA100",+ "FA102",+ "INT001",+ "INT002",+ "INT003",+ # "ISC004",+ # "LOG001",+ "LOG002",+ "LOG009",+ # "LOG014",+ # "LOG015",+ "G010",+ "G101",+ # "G201",+ "G202",+ "PIE790",+ "PIE794",+ "PIE796",+ "PIE800",+ "PIE804",+ "PIE807",+ "PIE808",+ # "PIE810",+ "PYI001",+ "PYI002",+ "PYI003",+ "PYI004",+ "PYI005",+ "PYI006",+ "PYI007",+ "PYI008",+ "PYI009",+ "PYI010",+ "PYI012",+ "PYI013",+ "PYI015",+ "PYI016",+ "PYI017",+ "PYI018",+ "PYI019",+ "PYI020",+ "PYI025",+ "PYI026",+ "PYI029",+ "PYI030",+ "PYI032",+ "PYI033",+ # "PYI034",+ "PYI035",+ "PYI036",+ "PYI041",+ "PYI042",+ "PYI043",+ "PYI044",+ "PYI045",+ "PYI046",+ "PYI047",+ "PYI048",+ "PYI049",+ "PYI050",+ "PYI052",+ "PYI055",+ "PYI057",+ "PYI058",+ "PYI059",+ "PYI061",+ "PYI062",+ "PYI063",+ "PYI064",+ "PYI066",+ "PT010",+ # "PT014",+ "PT020",+ "PT025",+ "PT026",+ "PT031",+ "RET501",+ "SIM101",+ # "SIM102",+ # "SIM103",+ "SIM107",+ # "SIM113",+ "SIM114",+ # "SIM115",+ # "SIM117",+ # "SIM118",+ # "SIM201",+ "SIM202",+ "SIM208",+ "SIM210",+ # "SIM211",+ "SIM220",+ "SIM221",+ "SIM222",+ "SIM223",+ # "SIM401",+ # "SIM905",+ "SIM911",+ "TC004",+ "TC005",+ "TC007",+ "TC010",+ "PTH124",+ "PTH210",+ # "FLY002",+ # "I001",+ # "N999",+ "PERF101",+ # "PERF102",+ "PERF402",+ "E722",+ "E902",+ "W605",+ "D419",+ # "F401",+ # "F402",+ "F404",+ "F407",+ "F501",+ "F502",+ "F503",+ "F504",+ "F505",+ "F506",+ "F507",+ "F508",+ "F509",+ "F521",+ "F522",+ "F523",+ "F524",+ "F525",+ "F541",+ # "F601",+ "F602",+ "F621",+ "F622",+ "F631",+ "F632",+ "F633",+ "F634",+ "F701",+ "F702",+ "F704",+ "F706",+ "F707",+ # "F811",+ # "F821",+ "F822",+ "F823",+ # "F841",+ "F842",+ "F901",+ "PGH005",+ "PLC0105",+ "PLC0131",+ "PLC0132",+ "PLC0205",+ # "PLC0206",+ "PLC0208",+ # "PLC0414",+ "PLC3002",+ "PLE0100",+ "PLE0101",+ "PLE0115",+ "PLE0116",+ "PLE0117",+ "PLE0118",+ "PLE0303",+ "PLE0304",+ "PLE0305",+ "PLE0307",+ "PLE0308",+ "PLE0309",+ "PLE0604",+ # "PLE0605",+ "PLE0643",+ # "PLE0704",+ "PLE1132",+ "PLE1142",+ "PLE1205",+ "PLE1206",+ "PLE1300",+ "PLE1307",+ "PLE1310",+ "PLE1507",+ "PLE1519",+ "PLE1520",+ "PLE1700",+ # "PLE2502",+ "PLE2510",+ "PLE2512",+ "PLE2513",+ "PLE2514",+ "PLE2515",+ # "PLR0124",+ "PLR0133",+ "PLR0206",+ "PLR0402",+ # "PLR1704",+ "PLR1708",+ "PLR1711",+ "PLR1716",+ "PLR1722",+ "PLR1730",+ "PLR1733",+ "PLR1736",+ "PLR2044",+ "PLW0120",+ "PLW0127",+ "PLW0128",+ "PLW0129",+ "PLW0131",+ "PLW0133",+ "PLW0177",+ "PLW0211",+ "PLW0245",+ "PLW0406",+ # "PLW0602",+ "PLW0604",+ "PLW0642",+ "PLW0711",+ "PLW1501",+ "PLW1507",+ # "PLW1508",+ # "PLW1509",+ # "PLW1510",+ # "PLW2101",+ "UP001",+ "UP003",+ "UP004",+ "UP005",+ "UP006",+ # "UP007",+ "UP008",+ "UP009",+ "UP010",+ "UP011",+ "UP012",+ "UP014",+ # "UP017",+ "UP018",+ "UP019",+ "UP020",+ "UP021",+ # "UP022",+ "UP023",+ "UP024",+ "UP025",+ "UP026",+ # "UP028",+ "UP029",+ "UP030",+ # "UP031",+ "UP032",+ "UP033",+ "UP034",+ # "UP035",+ "UP036",+ # "UP037",+ "UP039",+ "UP040",+ # "UP041",+ "UP043",+ "UP044",+ # "UP045",+ # "UP046",+ # "UP047",+ "UP049",+ "UP050",+ "FURB105",+ "FURB122",+ "FURB129",+ "FURB132",+ "FURB136",+ "FURB157",+ "FURB161",+ # "FURB162",+ "FURB163",+ "FURB166",+ "FURB167",+ "FURB168",+ "FURB169",+ "FURB177",+ "FURB181",+ # "FURB188",+ # "FURB192",+ # "RUF007",+ "RUF008",+ # "RUF009",+ "RUF010",+ # "RUF012",+ # "RUF013",+ # "RUF015",+ "RUF016",+ # "RUF017",+ # "RUF018",+ "RUF019",+ "RUF020",+ # "RUF022",+ "RUF023",+ # "RUF024",+ "RUF026",+ "RUF028",+ "RUF030",+ "RUF032",+ "RUF033",+ # "RUF034",+ "RUF040",+ "RUF041",+ # "RUF046",+ "RUF048",+ "RUF049",+ "RUF051",+ "RUF053",+ "RUF057",+ "RUF058",+ # "RUF059",+ "RUF063",+ "RUF068",+ "RUF100",+ "RUF101",+ "RUF200",+ # "TRY002",+ # "TRY004",+ # "TRY201",+ # "TRY203",+ # "TRY401",+]++[lint.mccabe]+max-complexity = 20\ No newline at end of file