Some checks failed
V2 CI/CD Pipeline / Pre-Flight Checks (push) Has been cancelled
V2 CI/CD Pipeline / Build & Dependencies (push) Has been cancelled
V2 CI/CD Pipeline / Code Quality & Linting (push) Has been cancelled
V2 CI/CD Pipeline / Unit Tests (100% Coverage Required) (push) Has been cancelled
V2 CI/CD Pipeline / Integration Tests (push) Has been cancelled
V2 CI/CD Pipeline / Performance Benchmarks (push) Has been cancelled
V2 CI/CD Pipeline / Decimal Precision Validation (push) Has been cancelled
V2 CI/CD Pipeline / Modularity Validation (push) Has been cancelled
V2 CI/CD Pipeline / Final Validation Summary (push) Has been cancelled
Created complete CI/CD infrastructure for V2 development: GitHub Actions Pipeline (.github/workflows/v2-ci.yml): - Pre-flight checks (branch naming, commit messages) - Build & dependency validation - Code quality with 40+ linters (golangci-lint) - Unit tests with MANDATORY 100% coverage enforcement - Integration tests with timeout management - Performance benchmarks (parser < 5ms, detection < 10ms, e2e < 50ms) - Decimal precision validation - Modularity validation (component independence) - Final validation summary with PR comments Code Quality (.golangci.yml): - 40+ enabled linters for comprehensive checks - Cyclomatic complexity limits (max 15) - Magic number detection - Security scanning (gosec) - Style checking with MEV/DEX terminology - Test file exclusions for appropriate linters Build Automation (Makefile): - build, test, test-coverage with 100% enforcement - lint, fmt, vet, security targets - deps-download, deps-verify, deps-tidy, deps-check - validate (full CI/CD locally) - bench (performance benchmarks) - check-modularity, check-circular - Color-coded output for better UX Git Optimization (.gitattributes): - LF normalization for cross-platform consistency - Binary file handling - Diff settings for Go files - Merge strategies - Export-ignore for archives Git Hooks (.git-hooks/): - pre-commit: format, tests, vet, secret detection, go.mod tidy - commit-msg: message format validation - README with installation instructions - install-git-hooks.sh script for easy setup Documentation (docs/planning/05_CI_CD_SETUP.md): - Complete pipeline architecture diagram - Local development workflow - GitHub Actions job descriptions - Performance optimizations (caching, parallel execution) - Failure handling and debugging - Branch protection rules - Deployment process - Best practices and troubleshooting Performance Targets: - Pipeline duration: < 15 minutes - Test coverage: 100% (enforced, non-negotiable) - Parser latency: < 5ms - Arbitrage detection: < 10ms - End-to-end: < 50ms 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
246 lines
5.3 KiB
YAML
246 lines
5.3 KiB
YAML
run:
|
|
timeout: 10m
|
|
tests: true
|
|
modules-download-mode: readonly
|
|
|
|
linters:
|
|
enable:
|
|
# Enabled by default
|
|
- errcheck # Unchecked errors
|
|
- gosimple # Simplify code
|
|
- govet # Suspicious constructs
|
|
- ineffassign # Ineffectual assignments
|
|
- staticcheck # Go static analysis
|
|
- typecheck # Type checking
|
|
- unused # Unused code
|
|
|
|
# Additional linters for V2
|
|
- bodyclose # Close HTTP response bodies
|
|
- cyclop # Cyclomatic complexity
|
|
- dupl # Duplicate code
|
|
- errname # Error naming conventions
|
|
- exhaustive # Exhaustive switch statements
|
|
- exportloopref # Loop variable references
|
|
- gochecknoinits # No init functions
|
|
- gocognit # Cognitive complexity
|
|
- goconst # Repeated strings as constants
|
|
- gocritic # Comprehensive checks
|
|
- gocyclo # Cyclomatic complexity
|
|
- godot # Comment punctuation
|
|
- gofmt # Format code
|
|
- goimports # Import organization
|
|
- gomnd # Magic numbers
|
|
- goprintffuncname # Printf-like function naming
|
|
- gosec # Security issues
|
|
- lll # Long lines
|
|
- makezero # Slice initialization
|
|
- misspell # Misspellings
|
|
- nakedret # Naked returns
|
|
- nestif # Deeply nested if statements
|
|
- nilerr # Nil error returns
|
|
- noctx # HTTP requests without context
|
|
- nolintlint # Nolint directives
|
|
- prealloc # Slice preallocation
|
|
- predeclared # Predeclared identifier shadowing
|
|
- revive # Golint replacement
|
|
- rowserrcheck # SQL rows.Err checking
|
|
- sqlclosecheck # SQL Close() checking
|
|
- stylecheck # Style checking
|
|
- thelper # Test helper detection
|
|
- unconvert # Unnecessary type conversions
|
|
- unparam # Unused function parameters
|
|
- wastedassign # Wasted assignments
|
|
- whitespace # Whitespace issues
|
|
|
|
linters-settings:
|
|
cyclop:
|
|
max-complexity: 15
|
|
skip-tests: true
|
|
|
|
gocognit:
|
|
min-complexity: 20
|
|
|
|
gocyclo:
|
|
min-complexity: 15
|
|
|
|
goconst:
|
|
min-len: 3
|
|
min-occurrences: 3
|
|
ignore-tests: true
|
|
|
|
gocritic:
|
|
enabled-tags:
|
|
- diagnostic
|
|
- experimental
|
|
- opinionated
|
|
- performance
|
|
- style
|
|
|
|
goimports:
|
|
local-prefixes: github.com/your-org/mev-bot
|
|
|
|
gomnd:
|
|
settings:
|
|
mnd:
|
|
checks:
|
|
- argument
|
|
- case
|
|
- condition
|
|
- operation
|
|
- return
|
|
- assign
|
|
ignored-numbers:
|
|
- '0'
|
|
- '1'
|
|
- '2'
|
|
- '10'
|
|
- '100'
|
|
- '1000'
|
|
ignored-functions:
|
|
- 'big.NewInt'
|
|
- 'big.NewFloat'
|
|
- 'time.After'
|
|
- 'time.Sleep'
|
|
- 'time.Duration'
|
|
|
|
gosec:
|
|
severity: medium
|
|
confidence: medium
|
|
excludes:
|
|
- G104 # Audit errors not checked (handled by errcheck)
|
|
- G304 # File path provided as taint input (false positives)
|
|
|
|
lll:
|
|
line-length: 120
|
|
tab-width: 4
|
|
|
|
misspell:
|
|
locale: US
|
|
ignore-words:
|
|
- arbitrum
|
|
- uniswap
|
|
- camelot
|
|
|
|
nakedret:
|
|
max-func-lines: 30
|
|
|
|
nestif:
|
|
min-complexity: 4
|
|
|
|
revive:
|
|
rules:
|
|
- name: blank-imports
|
|
- name: context-as-argument
|
|
- name: context-keys-type
|
|
- name: dot-imports
|
|
- name: error-return
|
|
- name: error-strings
|
|
- name: error-naming
|
|
- name: exported
|
|
- name: if-return
|
|
- name: increment-decrement
|
|
- name: var-naming
|
|
- name: var-declaration
|
|
- name: package-comments
|
|
- name: range
|
|
- name: receiver-naming
|
|
- name: time-naming
|
|
- name: unexported-return
|
|
- name: indent-error-flow
|
|
- name: errorf
|
|
- name: empty-block
|
|
- name: superfluous-else
|
|
- name: unused-parameter
|
|
- name: unreachable-code
|
|
- name: redefines-builtin-id
|
|
|
|
stylecheck:
|
|
checks: ["all", "-ST1000", "-ST1003"]
|
|
dot-import-whitelist:
|
|
- fmt
|
|
initialisms:
|
|
- ACL
|
|
- API
|
|
- ASCII
|
|
- CPU
|
|
- CSS
|
|
- DNS
|
|
- EOF
|
|
- GUID
|
|
- HTML
|
|
- HTTP
|
|
- HTTPS
|
|
- ID
|
|
- IP
|
|
- JSON
|
|
- QPS
|
|
- RAM
|
|
- RPC
|
|
- SLA
|
|
- SMTP
|
|
- SQL
|
|
- SSH
|
|
- TCP
|
|
- TLS
|
|
- TTL
|
|
- UDP
|
|
- UI
|
|
- GID
|
|
- UID
|
|
- UUID
|
|
- URI
|
|
- URL
|
|
- UTF8
|
|
- VM
|
|
- XML
|
|
- XMPP
|
|
- XSRF
|
|
- XSS
|
|
- ABI
|
|
- DEX
|
|
- MEV
|
|
- RLP
|
|
|
|
unparam:
|
|
check-exported: false
|
|
|
|
issues:
|
|
exclude-use-default: false
|
|
exclude-rules:
|
|
# Exclude some linters from running on tests files
|
|
- path: _test\.go
|
|
linters:
|
|
- gocyclo
|
|
- errcheck
|
|
- dupl
|
|
- gosec
|
|
- goconst
|
|
- gomnd
|
|
- lll
|
|
|
|
# Exclude known issues
|
|
- path: pkg/legacy/
|
|
linters:
|
|
- staticcheck
|
|
- gocritic
|
|
|
|
# Exclude duplicate code in protocol parsers (expected similarity)
|
|
- path: pkg/parsers/
|
|
linters:
|
|
- dupl
|
|
|
|
# Allow long lines in generated code
|
|
- path: pkg/generated/
|
|
linters:
|
|
- lll
|
|
|
|
max-issues-per-linter: 0
|
|
max-same-issues: 0
|
|
|
|
output:
|
|
format: colored-line-number
|
|
print-issued-lines: true
|
|
print-linter-name: true
|
|
uniq-by-line: true
|
|
sort-results: true
|