fix: fix lint in files and add a pipe for checking
All checks were successful
Lint / lint (pull_request) Successful in 10m28s
All checks were successful
Lint / lint (pull_request) Successful in 10m28s
This commit is contained in:
25
.gitea/workflows/lint.yaml
Normal file
25
.gitea/workflows/lint.yaml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
name: Lint
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- '**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run lint
|
||||||
|
run: npm run lint
|
||||||
@@ -21,7 +21,10 @@ module.exports = tseslint.config(
|
|||||||
'@typescript-eslint/no-unsafe-call': 'off',
|
'@typescript-eslint/no-unsafe-call': 'off',
|
||||||
'@typescript-eslint/no-unsafe-argument': 'off',
|
'@typescript-eslint/no-unsafe-argument': 'off',
|
||||||
'@typescript-eslint/require-await': 'off',
|
'@typescript-eslint/require-await': 'off',
|
||||||
'@typescript-eslint/no-unused-vars': ['warn', { 'argsIgnorePattern': '^_', 'varsIgnorePattern': '^_', 'caughtErrorsIgnorePattern': '^_' }]
|
'@typescript-eslint/no-unused-vars': [
|
||||||
|
'warn',
|
||||||
|
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
17
main.ts
17
main.ts
@@ -10,7 +10,10 @@ import { checkOpenApiGenerator, installOpenApiGenerator } from './src/utils/open
|
|||||||
import { createDirectoryStructure, cleanup } from './src/utils/filesystem';
|
import { createDirectoryStructure, cleanup } from './src/utils/filesystem';
|
||||||
import { analyzeSwagger } from './src/swagger/analyzer';
|
import { analyzeSwagger } from './src/swagger/analyzer';
|
||||||
import { generateCode, organizeFiles, addDtoImports } from './src/generators/dto.generator';
|
import { generateCode, organizeFiles, addDtoImports } from './src/generators/dto.generator';
|
||||||
import { generateCleanArchitecture, extractTagsFromAnalysis } from './src/generators/clean-arch.generator';
|
import {
|
||||||
|
generateCleanArchitecture,
|
||||||
|
extractTagsFromAnalysis
|
||||||
|
} from './src/generators/clean-arch.generator';
|
||||||
import { generateReport } from './src/generators/report.generator';
|
import { generateReport } from './src/generators/report.generator';
|
||||||
import { findEnvironmentFile, parseApiKeys } from './src/utils/environment-finder';
|
import { findEnvironmentFile, parseApiKeys } from './src/utils/environment-finder';
|
||||||
import { askApiKeysForTags } from './src/utils/prompt';
|
import { askApiKeysForTags } from './src/utils/prompt';
|
||||||
@@ -93,14 +96,20 @@ async function main(): Promise<void> {
|
|||||||
if (envFile) {
|
if (envFile) {
|
||||||
const envContent = fs.readFileSync(envFile, 'utf8');
|
const envContent = fs.readFileSync(envFile, 'utf8');
|
||||||
apiKeys = parseApiKeys(envContent);
|
apiKeys = parseApiKeys(envContent);
|
||||||
logSuccess(`environment.ts encontrado: ${colors.cyan}${path.relative(process.cwd(), envFile)}${colors.reset}`);
|
logSuccess(
|
||||||
|
`environment.ts encontrado: ${colors.cyan}${path.relative(process.cwd(), envFile)}${colors.reset}`
|
||||||
|
);
|
||||||
if (apiKeys.length > 0) {
|
if (apiKeys.length > 0) {
|
||||||
logInfo(`Claves de API detectadas: ${apiKeys.map((k) => k.key).join(', ')}`);
|
logInfo(`Claves de API detectadas: ${apiKeys.map((k) => k.key).join(', ')}`);
|
||||||
} else {
|
} else {
|
||||||
logWarning('No se encontraron claves con "api" en environment.ts. Se solicitará manualmente.');
|
logWarning(
|
||||||
|
'No se encontraron claves con "api" en environment.ts. Se solicitará manualmente.'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logWarning('No se encontró environment.ts. Se solicitará la clave manualmente por repositorio.');
|
logWarning(
|
||||||
|
'No se encontró environment.ts. Se solicitará la clave manualmente por repositorio.'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const tagApiKeyMap = await askApiKeysForTags(tags, apiKeys);
|
const tagApiKeyMap = await askApiKeysForTags(tags, apiKeys);
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ export function findEnvironmentFile(dir: string, maxDepth = 8, currentDepth = 0)
|
|||||||
if (found) return found;
|
if (found) return found;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch {
|
||||||
|
//bypass errors
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user