aidevops 2.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/AGENTS.md +614 -0
- package/.agent/accounts.md +65 -0
- package/.agent/aidevops/add-new-mcp-to-aidevops.md +456 -0
- package/.agent/aidevops/api-integrations.md +335 -0
- package/.agent/aidevops/architecture.md +510 -0
- package/.agent/aidevops/configs.md +274 -0
- package/.agent/aidevops/docs.md +244 -0
- package/.agent/aidevops/extension.md +311 -0
- package/.agent/aidevops/mcp-integrations.md +340 -0
- package/.agent/aidevops/mcp-troubleshooting.md +162 -0
- package/.agent/aidevops/memory-patterns.md +172 -0
- package/.agent/aidevops/providers.md +217 -0
- package/.agent/aidevops/recommendations.md +321 -0
- package/.agent/aidevops/requirements.md +301 -0
- package/.agent/aidevops/resources.md +214 -0
- package/.agent/aidevops/security-requirements.md +174 -0
- package/.agent/aidevops/security.md +350 -0
- package/.agent/aidevops/service-links.md +400 -0
- package/.agent/aidevops/services.md +357 -0
- package/.agent/aidevops/setup.md +153 -0
- package/.agent/aidevops/troubleshooting.md +389 -0
- package/.agent/aidevops.md +124 -0
- package/.agent/build-plus.md +244 -0
- package/.agent/content/guidelines.md +109 -0
- package/.agent/content.md +87 -0
- package/.agent/health.md +59 -0
- package/.agent/legal.md +59 -0
- package/.agent/loop-state/full-loop.local.md +16 -0
- package/.agent/loop-state/ralph-loop.local.md +10 -0
- package/.agent/marketing.md +440 -0
- package/.agent/memory/README.md +260 -0
- package/.agent/onboarding.md +796 -0
- package/.agent/plan-plus.md +245 -0
- package/.agent/research.md +100 -0
- package/.agent/sales.md +333 -0
- package/.agent/scripts/101domains-helper.sh +701 -0
- package/.agent/scripts/add-missing-returns.sh +140 -0
- package/.agent/scripts/agent-browser-helper.sh +311 -0
- package/.agent/scripts/agno-setup.sh +712 -0
- package/.agent/scripts/ahrefs-mcp-wrapper.js +168 -0
- package/.agent/scripts/aidevops-update-check.sh +71 -0
- package/.agent/scripts/ampcode-cli.sh +522 -0
- package/.agent/scripts/auto-version-bump.sh +156 -0
- package/.agent/scripts/autogen-helper.sh +512 -0
- package/.agent/scripts/beads-sync-helper.sh +596 -0
- package/.agent/scripts/closte-helper.sh +5 -0
- package/.agent/scripts/cloudron-helper.sh +321 -0
- package/.agent/scripts/codacy-cli-chunked.sh +581 -0
- package/.agent/scripts/codacy-cli.sh +442 -0
- package/.agent/scripts/code-audit-helper.sh +5 -0
- package/.agent/scripts/coderabbit-cli.sh +417 -0
- package/.agent/scripts/coderabbit-pro-analysis.sh +238 -0
- package/.agent/scripts/commands/code-simplifier.md +86 -0
- package/.agent/scripts/commands/full-loop.md +246 -0
- package/.agent/scripts/commands/postflight-loop.md +103 -0
- package/.agent/scripts/commands/recall.md +182 -0
- package/.agent/scripts/commands/remember.md +132 -0
- package/.agent/scripts/commands/save-todo.md +175 -0
- package/.agent/scripts/commands/session-review.md +154 -0
- package/.agent/scripts/comprehensive-quality-fix.sh +106 -0
- package/.agent/scripts/context-builder-helper.sh +522 -0
- package/.agent/scripts/coolify-cli-helper.sh +674 -0
- package/.agent/scripts/coolify-helper.sh +380 -0
- package/.agent/scripts/crawl4ai-examples.sh +401 -0
- package/.agent/scripts/crawl4ai-helper.sh +1078 -0
- package/.agent/scripts/crewai-helper.sh +681 -0
- package/.agent/scripts/dev-browser-helper.sh +513 -0
- package/.agent/scripts/dns-helper.sh +396 -0
- package/.agent/scripts/domain-research-helper.sh +917 -0
- package/.agent/scripts/dspy-helper.sh +285 -0
- package/.agent/scripts/dspyground-helper.sh +291 -0
- package/.agent/scripts/eeat-score-helper.sh +1242 -0
- package/.agent/scripts/efficient-return-fix.sh +92 -0
- package/.agent/scripts/extract-opencode-prompts.sh +128 -0
- package/.agent/scripts/find-missing-returns.sh +113 -0
- package/.agent/scripts/fix-auth-headers.sh +104 -0
- package/.agent/scripts/fix-common-strings.sh +254 -0
- package/.agent/scripts/fix-content-type.sh +100 -0
- package/.agent/scripts/fix-error-messages.sh +130 -0
- package/.agent/scripts/fix-misplaced-returns.sh +74 -0
- package/.agent/scripts/fix-remaining-literals.sh +152 -0
- package/.agent/scripts/fix-return-statements.sh +41 -0
- package/.agent/scripts/fix-s131-default-cases.sh +249 -0
- package/.agent/scripts/fix-sc2155-simple.sh +102 -0
- package/.agent/scripts/fix-shellcheck-critical.sh +187 -0
- package/.agent/scripts/fix-string-literals.sh +273 -0
- package/.agent/scripts/full-loop-helper.sh +773 -0
- package/.agent/scripts/generate-opencode-agents.sh +497 -0
- package/.agent/scripts/generate-opencode-commands.sh +1629 -0
- package/.agent/scripts/generate-skills.sh +366 -0
- package/.agent/scripts/git-platforms-helper.sh +640 -0
- package/.agent/scripts/gitea-cli-helper.sh +743 -0
- package/.agent/scripts/github-cli-helper.sh +702 -0
- package/.agent/scripts/gitlab-cli-helper.sh +682 -0
- package/.agent/scripts/gsc-add-user-helper.sh +325 -0
- package/.agent/scripts/gsc-sitemap-helper.sh +678 -0
- package/.agent/scripts/hetzner-helper.sh +485 -0
- package/.agent/scripts/hostinger-helper.sh +229 -0
- package/.agent/scripts/keyword-research-helper.sh +1815 -0
- package/.agent/scripts/langflow-helper.sh +544 -0
- package/.agent/scripts/linkedin-automation.py +241 -0
- package/.agent/scripts/linter-manager.sh +599 -0
- package/.agent/scripts/linters-local.sh +434 -0
- package/.agent/scripts/list-keys-helper.sh +488 -0
- package/.agent/scripts/local-browser-automation.py +339 -0
- package/.agent/scripts/localhost-helper.sh +744 -0
- package/.agent/scripts/loop-common.sh +806 -0
- package/.agent/scripts/mainwp-helper.sh +728 -0
- package/.agent/scripts/markdown-formatter.sh +338 -0
- package/.agent/scripts/markdown-lint-fix.sh +311 -0
- package/.agent/scripts/mass-fix-returns.sh +58 -0
- package/.agent/scripts/mcp-diagnose.sh +167 -0
- package/.agent/scripts/mcp-inspector-helper.sh +449 -0
- package/.agent/scripts/memory-helper.sh +650 -0
- package/.agent/scripts/monitor-code-review.sh +255 -0
- package/.agent/scripts/onboarding-helper.sh +706 -0
- package/.agent/scripts/opencode-github-setup-helper.sh +797 -0
- package/.agent/scripts/opencode-test-helper.sh +213 -0
- package/.agent/scripts/pagespeed-helper.sh +464 -0
- package/.agent/scripts/pandoc-helper.sh +362 -0
- package/.agent/scripts/postflight-check.sh +555 -0
- package/.agent/scripts/pre-commit-hook.sh +259 -0
- package/.agent/scripts/pre-edit-check.sh +169 -0
- package/.agent/scripts/qlty-cli.sh +356 -0
- package/.agent/scripts/quality-cli-manager.sh +525 -0
- package/.agent/scripts/quality-feedback-helper.sh +462 -0
- package/.agent/scripts/quality-fix.sh +263 -0
- package/.agent/scripts/quality-loop-helper.sh +1108 -0
- package/.agent/scripts/ralph-loop-helper.sh +836 -0
- package/.agent/scripts/ralph-upstream-check.sh +341 -0
- package/.agent/scripts/secretlint-helper.sh +847 -0
- package/.agent/scripts/servers-helper.sh +241 -0
- package/.agent/scripts/ses-helper.sh +619 -0
- package/.agent/scripts/session-review-helper.sh +404 -0
- package/.agent/scripts/setup-linters-wizard.sh +379 -0
- package/.agent/scripts/setup-local-api-keys.sh +330 -0
- package/.agent/scripts/setup-mcp-integrations.sh +472 -0
- package/.agent/scripts/shared-constants.sh +246 -0
- package/.agent/scripts/site-crawler-helper.sh +1487 -0
- package/.agent/scripts/snyk-helper.sh +940 -0
- package/.agent/scripts/sonarcloud-autofix.sh +193 -0
- package/.agent/scripts/sonarcloud-cli.sh +191 -0
- package/.agent/scripts/sonarscanner-cli.sh +455 -0
- package/.agent/scripts/spaceship-helper.sh +747 -0
- package/.agent/scripts/stagehand-helper.sh +321 -0
- package/.agent/scripts/stagehand-python-helper.sh +321 -0
- package/.agent/scripts/stagehand-python-setup.sh +441 -0
- package/.agent/scripts/stagehand-setup.sh +439 -0
- package/.agent/scripts/system-cleanup.sh +340 -0
- package/.agent/scripts/terminal-title-helper.sh +388 -0
- package/.agent/scripts/terminal-title-setup.sh +549 -0
- package/.agent/scripts/test-stagehand-both-integration.sh +317 -0
- package/.agent/scripts/test-stagehand-integration.sh +309 -0
- package/.agent/scripts/test-stagehand-python-integration.sh +341 -0
- package/.agent/scripts/todo-ready.sh +263 -0
- package/.agent/scripts/tool-version-check.sh +362 -0
- package/.agent/scripts/toon-helper.sh +469 -0
- package/.agent/scripts/twilio-helper.sh +917 -0
- package/.agent/scripts/updown-helper.sh +279 -0
- package/.agent/scripts/validate-mcp-integrations.sh +250 -0
- package/.agent/scripts/validate-version-consistency.sh +131 -0
- package/.agent/scripts/vaultwarden-helper.sh +597 -0
- package/.agent/scripts/vercel-cli-helper.sh +816 -0
- package/.agent/scripts/verify-mirrors.sh +169 -0
- package/.agent/scripts/version-manager.sh +831 -0
- package/.agent/scripts/webhosting-helper.sh +471 -0
- package/.agent/scripts/webhosting-verify.sh +238 -0
- package/.agent/scripts/wordpress-mcp-helper.sh +508 -0
- package/.agent/scripts/worktree-helper.sh +595 -0
- package/.agent/scripts/worktree-sessions.sh +577 -0
- package/.agent/seo/dataforseo.md +215 -0
- package/.agent/seo/domain-research.md +532 -0
- package/.agent/seo/eeat-score.md +659 -0
- package/.agent/seo/google-search-console.md +366 -0
- package/.agent/seo/gsc-sitemaps.md +282 -0
- package/.agent/seo/keyword-research.md +521 -0
- package/.agent/seo/serper.md +278 -0
- package/.agent/seo/site-crawler.md +387 -0
- package/.agent/seo.md +236 -0
- package/.agent/services/accounting/quickfile.md +159 -0
- package/.agent/services/communications/telfon.md +470 -0
- package/.agent/services/communications/twilio.md +569 -0
- package/.agent/services/crm/fluentcrm.md +449 -0
- package/.agent/services/email/ses.md +399 -0
- package/.agent/services/hosting/101domains.md +378 -0
- package/.agent/services/hosting/closte.md +177 -0
- package/.agent/services/hosting/cloudflare.md +251 -0
- package/.agent/services/hosting/cloudron.md +478 -0
- package/.agent/services/hosting/dns-providers.md +335 -0
- package/.agent/services/hosting/domain-purchasing.md +344 -0
- package/.agent/services/hosting/hetzner.md +327 -0
- package/.agent/services/hosting/hostinger.md +287 -0
- package/.agent/services/hosting/localhost.md +419 -0
- package/.agent/services/hosting/spaceship.md +353 -0
- package/.agent/services/hosting/webhosting.md +330 -0
- package/.agent/social-media.md +69 -0
- package/.agent/templates/plans-template.md +114 -0
- package/.agent/templates/prd-template.md +129 -0
- package/.agent/templates/tasks-template.md +108 -0
- package/.agent/templates/todo-template.md +89 -0
- package/.agent/tools/ai-assistants/agno.md +471 -0
- package/.agent/tools/ai-assistants/capsolver.md +326 -0
- package/.agent/tools/ai-assistants/configuration.md +221 -0
- package/.agent/tools/ai-assistants/overview.md +209 -0
- package/.agent/tools/ai-assistants/status.md +171 -0
- package/.agent/tools/ai-assistants/windsurf.md +193 -0
- package/.agent/tools/ai-orchestration/autogen.md +406 -0
- package/.agent/tools/ai-orchestration/crewai.md +445 -0
- package/.agent/tools/ai-orchestration/langflow.md +405 -0
- package/.agent/tools/ai-orchestration/openprose.md +487 -0
- package/.agent/tools/ai-orchestration/overview.md +362 -0
- package/.agent/tools/ai-orchestration/packaging.md +647 -0
- package/.agent/tools/browser/agent-browser.md +464 -0
- package/.agent/tools/browser/browser-automation.md +400 -0
- package/.agent/tools/browser/chrome-devtools.md +282 -0
- package/.agent/tools/browser/crawl4ai-integration.md +422 -0
- package/.agent/tools/browser/crawl4ai-resources.md +277 -0
- package/.agent/tools/browser/crawl4ai-usage.md +416 -0
- package/.agent/tools/browser/crawl4ai.md +585 -0
- package/.agent/tools/browser/dev-browser.md +341 -0
- package/.agent/tools/browser/pagespeed.md +260 -0
- package/.agent/tools/browser/playwright.md +266 -0
- package/.agent/tools/browser/playwriter.md +310 -0
- package/.agent/tools/browser/stagehand-examples.md +456 -0
- package/.agent/tools/browser/stagehand-python.md +483 -0
- package/.agent/tools/browser/stagehand.md +421 -0
- package/.agent/tools/build-agent/agent-review.md +224 -0
- package/.agent/tools/build-agent/build-agent.md +784 -0
- package/.agent/tools/build-mcp/aidevops-plugin.md +476 -0
- package/.agent/tools/build-mcp/api-wrapper.md +445 -0
- package/.agent/tools/build-mcp/build-mcp.md +240 -0
- package/.agent/tools/build-mcp/deployment.md +401 -0
- package/.agent/tools/build-mcp/server-patterns.md +632 -0
- package/.agent/tools/build-mcp/transports.md +366 -0
- package/.agent/tools/code-review/auditing.md +383 -0
- package/.agent/tools/code-review/automation.md +219 -0
- package/.agent/tools/code-review/best-practices.md +203 -0
- package/.agent/tools/code-review/codacy.md +151 -0
- package/.agent/tools/code-review/code-simplifier.md +174 -0
- package/.agent/tools/code-review/code-standards.md +309 -0
- package/.agent/tools/code-review/coderabbit.md +101 -0
- package/.agent/tools/code-review/management.md +155 -0
- package/.agent/tools/code-review/qlty.md +248 -0
- package/.agent/tools/code-review/secretlint.md +565 -0
- package/.agent/tools/code-review/setup.md +250 -0
- package/.agent/tools/code-review/snyk.md +563 -0
- package/.agent/tools/code-review/tools.md +230 -0
- package/.agent/tools/content/summarize.md +353 -0
- package/.agent/tools/context/augment-context-engine.md +468 -0
- package/.agent/tools/context/context-builder-agent.md +76 -0
- package/.agent/tools/context/context-builder.md +375 -0
- package/.agent/tools/context/context7.md +371 -0
- package/.agent/tools/context/dspy.md +302 -0
- package/.agent/tools/context/dspyground.md +374 -0
- package/.agent/tools/context/llm-tldr.md +219 -0
- package/.agent/tools/context/osgrep.md +488 -0
- package/.agent/tools/context/prompt-optimization.md +338 -0
- package/.agent/tools/context/toon.md +292 -0
- package/.agent/tools/conversion/pandoc.md +304 -0
- package/.agent/tools/credentials/api-key-management.md +154 -0
- package/.agent/tools/credentials/api-key-setup.md +224 -0
- package/.agent/tools/credentials/environment-variables.md +180 -0
- package/.agent/tools/credentials/vaultwarden.md +382 -0
- package/.agent/tools/data-extraction/outscraper.md +974 -0
- package/.agent/tools/deployment/coolify-cli.md +388 -0
- package/.agent/tools/deployment/coolify-setup.md +353 -0
- package/.agent/tools/deployment/coolify.md +345 -0
- package/.agent/tools/deployment/vercel.md +390 -0
- package/.agent/tools/git/authentication.md +132 -0
- package/.agent/tools/git/gitea-cli.md +193 -0
- package/.agent/tools/git/github-actions.md +207 -0
- package/.agent/tools/git/github-cli.md +223 -0
- package/.agent/tools/git/gitlab-cli.md +190 -0
- package/.agent/tools/git/opencode-github-security.md +350 -0
- package/.agent/tools/git/opencode-github.md +328 -0
- package/.agent/tools/git/opencode-gitlab.md +252 -0
- package/.agent/tools/git/security.md +196 -0
- package/.agent/tools/git.md +207 -0
- package/.agent/tools/opencode/oh-my-opencode.md +375 -0
- package/.agent/tools/opencode/opencode-anthropic-auth.md +446 -0
- package/.agent/tools/opencode/opencode.md +651 -0
- package/.agent/tools/social-media/bird.md +437 -0
- package/.agent/tools/task-management/beads.md +336 -0
- package/.agent/tools/terminal/terminal-title.md +251 -0
- package/.agent/tools/ui/shadcn.md +196 -0
- package/.agent/tools/ui/ui-skills.md +115 -0
- package/.agent/tools/wordpress/localwp.md +311 -0
- package/.agent/tools/wordpress/mainwp.md +391 -0
- package/.agent/tools/wordpress/scf.md +527 -0
- package/.agent/tools/wordpress/wp-admin.md +729 -0
- package/.agent/tools/wordpress/wp-dev.md +940 -0
- package/.agent/tools/wordpress/wp-preferred.md +398 -0
- package/.agent/tools/wordpress.md +95 -0
- package/.agent/workflows/branch/bugfix.md +63 -0
- package/.agent/workflows/branch/chore.md +95 -0
- package/.agent/workflows/branch/experiment.md +115 -0
- package/.agent/workflows/branch/feature.md +59 -0
- package/.agent/workflows/branch/hotfix.md +98 -0
- package/.agent/workflows/branch/refactor.md +92 -0
- package/.agent/workflows/branch/release.md +96 -0
- package/.agent/workflows/branch.md +347 -0
- package/.agent/workflows/bug-fixing.md +267 -0
- package/.agent/workflows/changelog.md +129 -0
- package/.agent/workflows/code-audit-remote.md +279 -0
- package/.agent/workflows/conversation-starter.md +69 -0
- package/.agent/workflows/error-feedback.md +578 -0
- package/.agent/workflows/feature-development.md +355 -0
- package/.agent/workflows/git-workflow.md +702 -0
- package/.agent/workflows/multi-repo-workspace.md +268 -0
- package/.agent/workflows/plans.md +709 -0
- package/.agent/workflows/postflight.md +604 -0
- package/.agent/workflows/pr.md +571 -0
- package/.agent/workflows/preflight.md +278 -0
- package/.agent/workflows/ralph-loop.md +773 -0
- package/.agent/workflows/release.md +498 -0
- package/.agent/workflows/session-manager.md +254 -0
- package/.agent/workflows/session-review.md +311 -0
- package/.agent/workflows/sql-migrations.md +631 -0
- package/.agent/workflows/version-bump.md +283 -0
- package/.agent/workflows/wiki-update.md +333 -0
- package/.agent/workflows/worktree.md +477 -0
- package/LICENSE +21 -0
- package/README.md +1446 -0
- package/VERSION +1 -0
- package/aidevops.sh +1746 -0
- package/bin/aidevops +21 -0
- package/package.json +75 -0
- package/scripts/npm-postinstall.js +60 -0
- package/setup.sh +2366 -0
|
@@ -0,0 +1,599 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# shellcheck disable=SC2034,SC2155,SC2317,SC2329,SC2016,SC2181,SC1091,SC2154,SC2015,SC2086,SC2129,SC2030,SC2031,SC2119,SC2120,SC2001,SC2162,SC2088,SC2089,SC2090,SC2029,SC2006,SC2153
|
|
3
|
+
|
|
4
|
+
# Linter Manager - CodeFactor-Inspired Multi-Language Linter Installation
|
|
5
|
+
# Based on CodeFactor's comprehensive linter collection
|
|
6
|
+
#
|
|
7
|
+
# Author: AI DevOps Framework
|
|
8
|
+
# Version: 1.1.1
|
|
9
|
+
# Reference: https://docs.codefactor.io/bootcamp/analysis-tools/
|
|
10
|
+
|
|
11
|
+
# Colors for output
|
|
12
|
+
readonly GREEN='\033[0;32m'
|
|
13
|
+
readonly RED='\033[0;31m'
|
|
14
|
+
readonly YELLOW='\033[1;33m'
|
|
15
|
+
readonly BLUE='\033[0;34m'
|
|
16
|
+
readonly PURPLE='\033[0;35m'
|
|
17
|
+
readonly NC='\033[0m'
|
|
18
|
+
|
|
19
|
+
# Common constants
|
|
20
|
+
readonly ERROR_UNKNOWN_COMMAND="Unknown command:"
|
|
21
|
+
print_success() {
|
|
22
|
+
local message="$1"
|
|
23
|
+
echo -e "${GREEN}✅ $message${NC}"
|
|
24
|
+
return 0
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
print_error() {
|
|
28
|
+
local message="$1"
|
|
29
|
+
echo -e "${RED}❌ $message${NC}" >&2
|
|
30
|
+
return 0
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
print_warning() {
|
|
34
|
+
local message="$1"
|
|
35
|
+
echo -e "${YELLOW}⚠️ $message${NC}"
|
|
36
|
+
return 0
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
print_info() {
|
|
40
|
+
local message="$1"
|
|
41
|
+
echo -e "${BLUE}ℹ️ $message${NC}"
|
|
42
|
+
return 0
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
print_header() {
|
|
46
|
+
local message="$1"
|
|
47
|
+
echo -e "${PURPLE}🔧 $message${NC}"
|
|
48
|
+
echo "=========================================="
|
|
49
|
+
return 0
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
# Install global npm package (prefers Bun if available)
|
|
53
|
+
install_npm_global() {
|
|
54
|
+
local packages=("$@")
|
|
55
|
+
if command -v bun &>/dev/null; then
|
|
56
|
+
bun install -g "${packages[@]}" &>/dev/null
|
|
57
|
+
elif command -v npm &>/dev/null; then
|
|
58
|
+
npm install -g --ignore-scripts "${packages[@]}" &>/dev/null
|
|
59
|
+
else
|
|
60
|
+
return 1
|
|
61
|
+
fi
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
# Detect project languages and frameworks
|
|
65
|
+
detect_project_languages() {
|
|
66
|
+
local languages=()
|
|
67
|
+
|
|
68
|
+
# Python
|
|
69
|
+
if [[ -f "requirements.txt" || -f "setup.py" || -f "pyproject.toml" || -f "Pipfile" ]]; then
|
|
70
|
+
languages+=("python")
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
# JavaScript/TypeScript/Node.js
|
|
74
|
+
if [[ -f "package.json" || -f "tsconfig.json" ]]; then
|
|
75
|
+
languages+=("javascript")
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
# CSS/SCSS/Less
|
|
79
|
+
if find . -name "*.css" -o -name "*.scss" -o -name "*.less" -o -name "*.sass" | head -1 | grep -q .; then
|
|
80
|
+
languages+=("css")
|
|
81
|
+
fi
|
|
82
|
+
|
|
83
|
+
# Shell scripts
|
|
84
|
+
if find . -name "*.sh" -o -name "*.bash" -o -name "*.zsh" | head -1 | grep -q .; then
|
|
85
|
+
languages+=("shell")
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
# Docker
|
|
89
|
+
if [[ -f "Dockerfile" ]] || find . -name "Dockerfile*" | head -1 | grep -q .; then
|
|
90
|
+
languages+=("docker")
|
|
91
|
+
fi
|
|
92
|
+
|
|
93
|
+
# YAML
|
|
94
|
+
if find . -name "*.yml" -o -name "*.yaml" | head -1 | grep -q .; then
|
|
95
|
+
languages+=("yaml")
|
|
96
|
+
fi
|
|
97
|
+
|
|
98
|
+
# Go
|
|
99
|
+
if [[ -f "go.mod" || -f "go.sum" ]]; then
|
|
100
|
+
languages+=("go")
|
|
101
|
+
fi
|
|
102
|
+
|
|
103
|
+
# PHP
|
|
104
|
+
if [[ -f "composer.json" ]] || find . -name "*.php" | head -1 | grep -q .; then
|
|
105
|
+
languages+=("php")
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
# Ruby
|
|
109
|
+
if [[ -f "Gemfile" || -f "Rakefile" ]] || find . -name "*.rb" | head -1 | grep -q .; then
|
|
110
|
+
languages+=("ruby")
|
|
111
|
+
fi
|
|
112
|
+
|
|
113
|
+
# Java
|
|
114
|
+
if [[ -f "pom.xml" || -f "build.gradle" ]] || find . -name "*.java" | head -1 | grep -q .; then
|
|
115
|
+
languages+=("java")
|
|
116
|
+
fi
|
|
117
|
+
|
|
118
|
+
# C#
|
|
119
|
+
if find . -name "*.cs" -o -name "*.csproj" -o -name "*.sln" | head -1 | grep -q .; then
|
|
120
|
+
languages+=("csharp")
|
|
121
|
+
fi
|
|
122
|
+
|
|
123
|
+
# Swift
|
|
124
|
+
if find . -name "*.swift" -o -name "Package.swift" | head -1 | grep -q .; then
|
|
125
|
+
languages+=("swift")
|
|
126
|
+
fi
|
|
127
|
+
|
|
128
|
+
# Kotlin
|
|
129
|
+
if find . -name "*.kt" -o -name "*.kts" | head -1 | grep -q .; then
|
|
130
|
+
languages+=("kotlin")
|
|
131
|
+
fi
|
|
132
|
+
|
|
133
|
+
# Dart/Flutter
|
|
134
|
+
if [[ -f "pubspec.yaml" ]] || find . -name "*.dart" | head -1 | grep -q .; then
|
|
135
|
+
languages+=("dart")
|
|
136
|
+
fi
|
|
137
|
+
|
|
138
|
+
# R
|
|
139
|
+
if find . -name "*.R" -o -name "*.r" -o -name "DESCRIPTION" | head -1 | grep -q .; then
|
|
140
|
+
languages+=("r")
|
|
141
|
+
fi
|
|
142
|
+
|
|
143
|
+
# C/C++
|
|
144
|
+
if find . -name "*.c" -o -name "*.cpp" -o -name "*.cc" -o -name "*.h" -o -name "*.hpp" | head -1 | grep -q .; then
|
|
145
|
+
languages+=("cpp")
|
|
146
|
+
fi
|
|
147
|
+
|
|
148
|
+
# Haskell
|
|
149
|
+
if find . -name "*.hs" -o -name "*.lhs" -o -name "*.cabal" | head -1 | grep -q .; then
|
|
150
|
+
languages+=("haskell")
|
|
151
|
+
fi
|
|
152
|
+
|
|
153
|
+
# Groovy
|
|
154
|
+
if find . -name "*.groovy" -o -name "*.gradle" | head -1 | grep -q .; then
|
|
155
|
+
languages+=("groovy")
|
|
156
|
+
fi
|
|
157
|
+
|
|
158
|
+
# PowerShell
|
|
159
|
+
if find . -name "*.ps1" -o -name "*.psm1" -o -name "*.psd1" | head -1 | grep -q .; then
|
|
160
|
+
languages+=("powershell")
|
|
161
|
+
fi
|
|
162
|
+
|
|
163
|
+
# Security scanning (always relevant)
|
|
164
|
+
languages+=("security")
|
|
165
|
+
|
|
166
|
+
printf '%s\n' "${languages[@]}"
|
|
167
|
+
return 0
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
# Install Python linters (CodeFactor: pycodestyle, Pylint, Bandit, Ruff)
|
|
171
|
+
install_python_linters() {
|
|
172
|
+
print_header "Installing Python Linters (CodeFactor-inspired)"
|
|
173
|
+
|
|
174
|
+
local success=0
|
|
175
|
+
local total=0
|
|
176
|
+
|
|
177
|
+
# pycodestyle (PEP 8 style guide checker)
|
|
178
|
+
print_info "Installing pycodestyle..."
|
|
179
|
+
if pip install pycodestyle &>/dev/null; then
|
|
180
|
+
print_success "pycodestyle installed"
|
|
181
|
+
((success++))
|
|
182
|
+
else
|
|
183
|
+
print_error "Failed to install pycodestyle"
|
|
184
|
+
fi
|
|
185
|
+
((total++))
|
|
186
|
+
|
|
187
|
+
# Pylint (comprehensive Python linter)
|
|
188
|
+
print_info "Installing Pylint..."
|
|
189
|
+
if pip install pylint &>/dev/null; then
|
|
190
|
+
print_success "Pylint installed"
|
|
191
|
+
((success++))
|
|
192
|
+
else
|
|
193
|
+
print_error "Failed to install Pylint"
|
|
194
|
+
fi
|
|
195
|
+
((total++))
|
|
196
|
+
|
|
197
|
+
# Bandit (security linter)
|
|
198
|
+
print_info "Installing Bandit..."
|
|
199
|
+
if pip install bandit &>/dev/null; then
|
|
200
|
+
print_success "Bandit installed"
|
|
201
|
+
((success++))
|
|
202
|
+
else
|
|
203
|
+
print_error "Failed to install Bandit"
|
|
204
|
+
fi
|
|
205
|
+
((total++))
|
|
206
|
+
|
|
207
|
+
# Ruff (fast Python linter)
|
|
208
|
+
print_info "Installing Ruff..."
|
|
209
|
+
if pip install ruff &>/dev/null; then
|
|
210
|
+
print_success "Ruff installed"
|
|
211
|
+
((success++))
|
|
212
|
+
else
|
|
213
|
+
print_error "Failed to install Ruff"
|
|
214
|
+
fi
|
|
215
|
+
((total++))
|
|
216
|
+
|
|
217
|
+
print_info "Python linters: $success/$total installed successfully"
|
|
218
|
+
return $((total - success))
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
# Install JavaScript/TypeScript linters (CodeFactor: Oxlint, ESLint)
|
|
222
|
+
install_javascript_linters() {
|
|
223
|
+
print_header "Installing JavaScript/TypeScript Linters (CodeFactor-inspired)"
|
|
224
|
+
|
|
225
|
+
local success=0
|
|
226
|
+
local total=0
|
|
227
|
+
|
|
228
|
+
# ESLint (JavaScript/TypeScript linter)
|
|
229
|
+
print_info "Installing ESLint..."
|
|
230
|
+
if install_npm_global eslint; then
|
|
231
|
+
print_success "ESLint installed"
|
|
232
|
+
((success++))
|
|
233
|
+
else
|
|
234
|
+
print_error "Failed to install ESLint"
|
|
235
|
+
fi
|
|
236
|
+
((total++))
|
|
237
|
+
|
|
238
|
+
# TypeScript ESLint parser and plugin
|
|
239
|
+
print_info "Installing TypeScript ESLint support..."
|
|
240
|
+
if install_npm_global @typescript-eslint/parser @typescript-eslint/eslint-plugin; then
|
|
241
|
+
print_success "TypeScript ESLint support installed"
|
|
242
|
+
((success++))
|
|
243
|
+
else
|
|
244
|
+
print_error "Failed to install TypeScript ESLint support"
|
|
245
|
+
fi
|
|
246
|
+
((total++))
|
|
247
|
+
|
|
248
|
+
print_info "JavaScript/TypeScript linters: $success/$total installed successfully"
|
|
249
|
+
return $((total - success))
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
# Install CSS linters (CodeFactor: Stylelint)
|
|
253
|
+
install_css_linters() {
|
|
254
|
+
print_header "Installing CSS/SCSS/Less Linters (CodeFactor-inspired)"
|
|
255
|
+
|
|
256
|
+
local success=0
|
|
257
|
+
local total=0
|
|
258
|
+
|
|
259
|
+
# Stylelint (CSS/SCSS/Less linter)
|
|
260
|
+
print_info "Installing Stylelint..."
|
|
261
|
+
if install_npm_global stylelint stylelint-config-standard; then
|
|
262
|
+
print_success "Stylelint installed"
|
|
263
|
+
((success++))
|
|
264
|
+
else
|
|
265
|
+
print_error "Failed to install Stylelint"
|
|
266
|
+
fi
|
|
267
|
+
((total++))
|
|
268
|
+
|
|
269
|
+
print_info "CSS linters: $success/$total installed successfully"
|
|
270
|
+
return $((total - success))
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
# Install Shell linters (CodeFactor: ShellCheck)
|
|
274
|
+
install_shell_linters() {
|
|
275
|
+
print_header "Installing Shell Script Linters (CodeFactor-inspired)"
|
|
276
|
+
|
|
277
|
+
local success=0
|
|
278
|
+
local total=0
|
|
279
|
+
|
|
280
|
+
# ShellCheck (shell script linter)
|
|
281
|
+
print_info "Installing ShellCheck..."
|
|
282
|
+
if command -v shellcheck &>/dev/null; then
|
|
283
|
+
print_success "ShellCheck already installed"
|
|
284
|
+
((success++))
|
|
285
|
+
elif brew install shellcheck &>/dev/null; then
|
|
286
|
+
print_success "ShellCheck installed via Homebrew"
|
|
287
|
+
((success++))
|
|
288
|
+
elif apt-get install -y shellcheck &>/dev/null; then
|
|
289
|
+
print_success "ShellCheck installed via apt"
|
|
290
|
+
((success++))
|
|
291
|
+
else
|
|
292
|
+
print_error "Failed to install ShellCheck"
|
|
293
|
+
fi
|
|
294
|
+
((total++))
|
|
295
|
+
|
|
296
|
+
print_info "Shell linters: $success/$total installed successfully"
|
|
297
|
+
return $((total - success))
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
# Install Docker linters (CodeFactor: Hadolint)
|
|
301
|
+
install_docker_linters() {
|
|
302
|
+
print_header "Installing Docker Linters (CodeFactor-inspired)"
|
|
303
|
+
|
|
304
|
+
local success=0
|
|
305
|
+
local total=0
|
|
306
|
+
|
|
307
|
+
# Hadolint (Dockerfile linter)
|
|
308
|
+
print_info "Installing Hadolint..."
|
|
309
|
+
if command -v hadolint &>/dev/null; then
|
|
310
|
+
print_success "Hadolint already installed"
|
|
311
|
+
((success++))
|
|
312
|
+
elif brew install hadolint &>/dev/null; then
|
|
313
|
+
print_success "Hadolint installed via Homebrew"
|
|
314
|
+
((success++))
|
|
315
|
+
else
|
|
316
|
+
print_error "Failed to install Hadolint"
|
|
317
|
+
fi
|
|
318
|
+
((total++))
|
|
319
|
+
|
|
320
|
+
print_info "Docker linters: $success/$total installed successfully"
|
|
321
|
+
return $((total - success))
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
# Install YAML linters (CodeFactor: Yamllint)
|
|
325
|
+
install_yaml_linters() {
|
|
326
|
+
print_header "Installing YAML Linters (CodeFactor-inspired)"
|
|
327
|
+
|
|
328
|
+
local success=0
|
|
329
|
+
local total=0
|
|
330
|
+
|
|
331
|
+
# yamllint (YAML linter)
|
|
332
|
+
print_info "Installing yamllint..."
|
|
333
|
+
if pip install yamllint &>/dev/null; then
|
|
334
|
+
print_success "yamllint installed"
|
|
335
|
+
((success++))
|
|
336
|
+
else
|
|
337
|
+
print_error "Failed to install yamllint"
|
|
338
|
+
fi
|
|
339
|
+
((total++))
|
|
340
|
+
|
|
341
|
+
print_info "YAML linters: $success/$total installed successfully"
|
|
342
|
+
return $((total - success))
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
# Install Security linters (CodeFactor: Trivy, Secretlint)
|
|
346
|
+
install_security_linters() {
|
|
347
|
+
print_header "Installing Security Linters (CodeFactor-inspired)"
|
|
348
|
+
|
|
349
|
+
local success=0
|
|
350
|
+
local total=0
|
|
351
|
+
|
|
352
|
+
# Trivy (vulnerability scanner)
|
|
353
|
+
print_info "Installing Trivy..."
|
|
354
|
+
if command -v trivy &>/dev/null; then
|
|
355
|
+
print_success "Trivy already installed"
|
|
356
|
+
((success++))
|
|
357
|
+
elif brew install trivy &>/dev/null; then
|
|
358
|
+
print_success "Trivy installed via Homebrew"
|
|
359
|
+
((success++))
|
|
360
|
+
else
|
|
361
|
+
print_error "Failed to install Trivy"
|
|
362
|
+
fi
|
|
363
|
+
((total++))
|
|
364
|
+
|
|
365
|
+
# Secretlint (secret detection)
|
|
366
|
+
print_info "Installing Secretlint..."
|
|
367
|
+
if command -v secretlint &>/dev/null; then
|
|
368
|
+
print_success "Secretlint already installed"
|
|
369
|
+
((success++))
|
|
370
|
+
elif install_npm_global secretlint @secretlint/secretlint-rule-preset-recommend; then
|
|
371
|
+
print_success "Secretlint installed"
|
|
372
|
+
((success++))
|
|
373
|
+
else
|
|
374
|
+
print_error "Failed to install Secretlint"
|
|
375
|
+
fi
|
|
376
|
+
((total++))
|
|
377
|
+
|
|
378
|
+
print_info "Security linters: $success/$total installed successfully"
|
|
379
|
+
return $((total - success))
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
# Install linters for detected languages
|
|
383
|
+
install_detected_linters() {
|
|
384
|
+
print_header "Auto-Installing Linters for Detected Languages"
|
|
385
|
+
|
|
386
|
+
local languages_output
|
|
387
|
+
languages_output=$(detect_project_languages)
|
|
388
|
+
|
|
389
|
+
if [[ -z "$languages_output" ]]; then
|
|
390
|
+
print_warning "No supported languages detected in current directory"
|
|
391
|
+
return 1
|
|
392
|
+
fi
|
|
393
|
+
|
|
394
|
+
# Convert output to array
|
|
395
|
+
local -a languages
|
|
396
|
+
mapfile -t languages <<< "$languages_output"
|
|
397
|
+
|
|
398
|
+
print_info "Detected languages: ${languages[*]}"
|
|
399
|
+
echo ""
|
|
400
|
+
|
|
401
|
+
local total_failures=0
|
|
402
|
+
|
|
403
|
+
for lang in "${languages[@]}"; do
|
|
404
|
+
case "$lang" in
|
|
405
|
+
"python")
|
|
406
|
+
install_python_linters
|
|
407
|
+
((total_failures += $?))
|
|
408
|
+
;;
|
|
409
|
+
"javascript")
|
|
410
|
+
install_javascript_linters
|
|
411
|
+
((total_failures += $?))
|
|
412
|
+
;;
|
|
413
|
+
"css")
|
|
414
|
+
install_css_linters
|
|
415
|
+
((total_failures += $?))
|
|
416
|
+
;;
|
|
417
|
+
"shell")
|
|
418
|
+
install_shell_linters
|
|
419
|
+
((total_failures += $?))
|
|
420
|
+
;;
|
|
421
|
+
"docker")
|
|
422
|
+
install_docker_linters
|
|
423
|
+
((total_failures += $?))
|
|
424
|
+
;;
|
|
425
|
+
"yaml")
|
|
426
|
+
install_yaml_linters
|
|
427
|
+
((total_failures += $?))
|
|
428
|
+
;;
|
|
429
|
+
"security")
|
|
430
|
+
install_security_linters
|
|
431
|
+
((total_failures += $?))
|
|
432
|
+
;;
|
|
433
|
+
*)
|
|
434
|
+
print_warning "Unknown language: $lang - skipping"
|
|
435
|
+
;;
|
|
436
|
+
esac
|
|
437
|
+
echo ""
|
|
438
|
+
done
|
|
439
|
+
|
|
440
|
+
if [[ $total_failures -eq 0 ]]; then
|
|
441
|
+
print_success "All linters installed successfully!"
|
|
442
|
+
else
|
|
443
|
+
print_warning "Some linters failed to install ($total_failures failures)"
|
|
444
|
+
fi
|
|
445
|
+
|
|
446
|
+
return $total_failures
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
# Install all supported linters
|
|
450
|
+
install_all_linters() {
|
|
451
|
+
print_header "Installing All Supported Linters (CodeFactor Collection)"
|
|
452
|
+
|
|
453
|
+
local total_failures=0
|
|
454
|
+
|
|
455
|
+
install_python_linters
|
|
456
|
+
((total_failures += $?))
|
|
457
|
+
echo ""
|
|
458
|
+
|
|
459
|
+
install_javascript_linters
|
|
460
|
+
((total_failures += $?))
|
|
461
|
+
echo ""
|
|
462
|
+
|
|
463
|
+
install_css_linters
|
|
464
|
+
((total_failures += $?))
|
|
465
|
+
echo ""
|
|
466
|
+
|
|
467
|
+
install_shell_linters
|
|
468
|
+
((total_failures += $?))
|
|
469
|
+
echo ""
|
|
470
|
+
|
|
471
|
+
install_docker_linters
|
|
472
|
+
((total_failures += $?))
|
|
473
|
+
echo ""
|
|
474
|
+
|
|
475
|
+
install_yaml_linters
|
|
476
|
+
((total_failures += $?))
|
|
477
|
+
echo ""
|
|
478
|
+
|
|
479
|
+
install_security_linters
|
|
480
|
+
((total_failures += $?))
|
|
481
|
+
echo ""
|
|
482
|
+
|
|
483
|
+
if [[ $total_failures -eq 0 ]]; then
|
|
484
|
+
print_success "All linters installed successfully!"
|
|
485
|
+
else
|
|
486
|
+
print_warning "Some linters failed to install ($total_failures failures)"
|
|
487
|
+
fi
|
|
488
|
+
|
|
489
|
+
return $total_failures
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
# Show help
|
|
493
|
+
show_help() {
|
|
494
|
+
echo "Linter Manager - CodeFactor-Inspired Multi-Language Linter Installation"
|
|
495
|
+
echo ""
|
|
496
|
+
echo "Usage: $0 <command> [language]"
|
|
497
|
+
echo ""
|
|
498
|
+
echo "Commands:"
|
|
499
|
+
echo " detect - Detect languages in current project"
|
|
500
|
+
echo " install-detected - Install linters for detected languages"
|
|
501
|
+
echo " install-all - Install all supported linters"
|
|
502
|
+
echo " install <language> - Install linters for specific language"
|
|
503
|
+
echo " help - Show this help message"
|
|
504
|
+
echo ""
|
|
505
|
+
echo "Supported Languages:"
|
|
506
|
+
echo " python - pycodestyle, Pylint, Bandit, Ruff"
|
|
507
|
+
echo " javascript - ESLint, TypeScript ESLint"
|
|
508
|
+
echo " css - Stylelint"
|
|
509
|
+
echo " shell - ShellCheck"
|
|
510
|
+
echo " docker - Hadolint"
|
|
511
|
+
echo " yaml - yamllint"
|
|
512
|
+
echo " security - Trivy, Secretlint"
|
|
513
|
+
echo ""
|
|
514
|
+
echo "Examples:"
|
|
515
|
+
echo " $0 detect"
|
|
516
|
+
echo " $0 install-detected"
|
|
517
|
+
echo " $0 install-all"
|
|
518
|
+
echo " $0 install python"
|
|
519
|
+
echo " $0 install javascript"
|
|
520
|
+
echo ""
|
|
521
|
+
echo "Based on CodeFactor's comprehensive linter collection:"
|
|
522
|
+
echo "https://docs.codefactor.io/bootcamp/analysis-tools/"
|
|
523
|
+
return 0
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
# Main execution
|
|
527
|
+
main() {
|
|
528
|
+
local command="$1"
|
|
529
|
+
local language="$2"
|
|
530
|
+
|
|
531
|
+
case "$command" in
|
|
532
|
+
"detect")
|
|
533
|
+
print_header "Detecting Project Languages"
|
|
534
|
+
local languages_output
|
|
535
|
+
languages_output=$(detect_project_languages)
|
|
536
|
+
if [[ -n "$languages_output" ]]; then
|
|
537
|
+
print_info "Detected languages: $languages_output"
|
|
538
|
+
else
|
|
539
|
+
print_warning "No supported languages detected"
|
|
540
|
+
fi
|
|
541
|
+
;;
|
|
542
|
+
"install-detected")
|
|
543
|
+
install_detected_linters
|
|
544
|
+
;;
|
|
545
|
+
"install-all")
|
|
546
|
+
install_all_linters
|
|
547
|
+
;;
|
|
548
|
+
"install")
|
|
549
|
+
if [[ -z "$language" ]]; then
|
|
550
|
+
print_error "Language required for install command"
|
|
551
|
+
echo ""
|
|
552
|
+
show_help
|
|
553
|
+
return 1
|
|
554
|
+
fi
|
|
555
|
+
|
|
556
|
+
case "$language" in
|
|
557
|
+
"python")
|
|
558
|
+
install_python_linters
|
|
559
|
+
;;
|
|
560
|
+
"javascript")
|
|
561
|
+
install_javascript_linters
|
|
562
|
+
;;
|
|
563
|
+
"css")
|
|
564
|
+
install_css_linters
|
|
565
|
+
;;
|
|
566
|
+
"shell")
|
|
567
|
+
install_shell_linters
|
|
568
|
+
;;
|
|
569
|
+
"docker")
|
|
570
|
+
install_docker_linters
|
|
571
|
+
;;
|
|
572
|
+
"yaml")
|
|
573
|
+
install_yaml_linters
|
|
574
|
+
;;
|
|
575
|
+
"security")
|
|
576
|
+
install_security_linters
|
|
577
|
+
;;
|
|
578
|
+
*)
|
|
579
|
+
print_error "Unsupported language: $language"
|
|
580
|
+
echo ""
|
|
581
|
+
show_help
|
|
582
|
+
return 1
|
|
583
|
+
;;
|
|
584
|
+
esac
|
|
585
|
+
;;
|
|
586
|
+
"help"|"--help"|"-h"|"")
|
|
587
|
+
show_help
|
|
588
|
+
;;
|
|
589
|
+
*)
|
|
590
|
+
print_error "$ERROR_UNKNOWN_COMMAND $command"
|
|
591
|
+
echo ""
|
|
592
|
+
show_help
|
|
593
|
+
return 1
|
|
594
|
+
;;
|
|
595
|
+
esac
|
|
596
|
+
return 0
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
main "$@"
|