mirror of
https://github.com/embersparks/obsidian-github-stars-manager.git
synced 2026-07-22 06:44:31 +00:00
主要功能: - 支持多种格式导出 GitHub stars(JSON、CSV、Markdown、TXT) - 添加完整的主题系统,支持亮色/暗色模式 - 集成 emoji 支持,增强用户体验 - 优化 GitHub Actions 工作流配置 - 完善部署脚本和文档 技术改进: - 重构项目结构,提升代码可维护性 - 添加类型定义,增强类型安全 - 优化 UI 组件和用户交互 - 完善错误处理和边界情况 🤖 Generated with [Claude Code](https://claude.ai/code)
131 lines
No EOL
3.8 KiB
YAML
131 lines
No EOL
3.8 KiB
YAML
name: Code Quality
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, master, feature/* ]
|
|
pull_request:
|
|
branches: [ main, master ]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20.x'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run ESLint (if available)
|
|
run: |
|
|
if npm list --silent eslint 2>/dev/null; then
|
|
npm run lint || echo "Lint command not found, skipping..."
|
|
else
|
|
echo "ESLint not installed, skipping..."
|
|
fi
|
|
|
|
- name: Check for common issues
|
|
run: |
|
|
echo "Checking for common TypeScript issues..."
|
|
|
|
# Check for console.log statements (warnings only)
|
|
if grep -r "console\.log" src/ --include="*.ts" --include="*.js" | grep -v "console\.log(" | head -5; then
|
|
echo "⚠️ Found console.log statements in source code"
|
|
fi
|
|
|
|
# Check for TODO comments
|
|
if grep -r "TODO\|FIXME\|HACK" src/ --include="*.ts" --include="*.js" | head -5; then
|
|
echo "⚠️ Found TODO/FIXME comments"
|
|
fi
|
|
|
|
# Check for potential security issues
|
|
if grep -r "eval\|innerHTML\|document\.write" src/ --include="*.ts" --include="*.js" | head -3; then
|
|
echo "⚠️ Found potentially unsafe code patterns"
|
|
fi
|
|
|
|
echo "✅ Code quality checks completed"
|
|
|
|
format-check:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20.x'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Check Prettier formatting (if available)
|
|
run: |
|
|
if npm list --silent prettier 2>/dev/null; then
|
|
if npm run --silent | grep -q "format"; then
|
|
npm run format:check || echo "Format check command not found, skipping..."
|
|
else
|
|
echo "No format script found, skipping..."
|
|
fi
|
|
else
|
|
echo "Prettier not installed, skipping..."
|
|
fi
|
|
|
|
dependencies:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20.x'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Check for outdated dependencies
|
|
run: |
|
|
echo "Checking for outdated dependencies..."
|
|
npm outdated || echo "No outdated dependencies found"
|
|
|
|
- name: Check for security vulnerabilities
|
|
run: |
|
|
echo "Checking for security vulnerabilities..."
|
|
npm audit --audit-level=moderate || echo "Security audit completed with warnings"
|
|
|
|
- name: Validate package.json
|
|
run: |
|
|
echo "Validating package.json..."
|
|
node -e "
|
|
const pkg = require('./package.json');
|
|
|
|
// Check required fields
|
|
const required = ['name', 'version', 'main', 'scripts'];
|
|
for (const field of required) {
|
|
if (!pkg[field]) {
|
|
console.error(\`Missing required field in package.json: \${field}\`);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
// Check build script
|
|
if (!pkg.scripts.build) {
|
|
console.error('Build script not found in package.json');
|
|
process.exit(1);
|
|
}
|
|
|
|
console.log('✅ package.json is valid');
|
|
" |