Skip to content

Commit 515863f

Browse files
committed
[megalinter] setup megalinter
[megalinter] setup megalinter configs
1 parent c889d62 commit 515863f

File tree

6 files changed

+61
-6
lines changed

6 files changed

+61
-6
lines changed

.github/workflows/megalinter.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
run: |
1818
deno run -A src/dagger/list_jobs.ts
1919
dagger functions
20-
dagger call lint --src . --path examples
20+
dagger call lint --src examples/playbooks
2121
working-directory: megalinter
2222
publish:
2323
needs: test

megalinter/examples/.cspell.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"ignorePaths": [
3+
"**/node_modules/**",
4+
"**/vscode-extension/**",
5+
"**/.git/**",
6+
"**/.pnpm-lock.json",
7+
".vscode",
8+
"megalinter",
9+
"package-lock.json",
10+
"report"
11+
],
12+
"language": "en",
13+
"noConfigSearch": true,
14+
"words": ["megalinter", "oxsecurity"],
15+
"version": "0.2"
16+
}

megalinter/examples/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
megalinter-reports/

megalinter/examples/.jscpd.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"threshold": 0,
3+
"reporters": ["html", "markdown"],
4+
"ignore": [
5+
"**/node_modules/**",
6+
"**/.git/**",
7+
"**/.rbenv/**",
8+
"**/.venv/**",
9+
"**/*cache*/**",
10+
"**/.github/**",
11+
"**/.idea/**",
12+
"**/report/**",
13+
"**/*.svg"
14+
]
15+
}

megalinter/examples/.mega-linter.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Configuration file for MegaLinter
2+
#
3+
# See all available variables at https://megalinter.io/latest/config-file/ and in
4+
# linters documentation
5+
6+
# all, none, or list of linter keys
7+
APPLY_FIXES: all
8+
9+
# If you use ENABLE variable, all other languages/formats/tooling-formats will
10+
# be disabled by default
11+
# ENABLE:
12+
13+
# If you use ENABLE_LINTERS variable, all other linters will be disabled by
14+
# default
15+
# ENABLE_LINTERS:
16+
17+
# DISABLE:
18+
# - COPYPASTE # Uncomment to disable checks of excessive copy-pastes
19+
# - SPELL # Uncomment to disable checks of spelling mistakes
20+
21+
SHOW_ELAPSED_TIME: true
22+
23+
FILEIO_REPORTER: true
24+
25+
# Uncomment if you want MegaLinter to detect errors but not block CI to pass
26+
# DISABLE_ERRORS: true

megalinter/src/dagger/jobs.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,18 @@ export const exclude = [];
1717
* @function
1818
* @description Lint files.
1919
* @param {string | Directory | undefined} src
20-
* @param {string} path
2120
* @returns {Directory | string}
2221
*/
2322
export async function lint(
24-
src: Directory | string,
25-
path = "."
23+
src: Directory | string
2624
): Promise<Directory | string> {
2725
const context = await getDirectory(src);
2826
const ctr = dag
2927
.pipeline(Job.lint)
3028
.container()
3129
.from("oxsecurity/megalinter:v7")
3230
.withDirectory("/app", context)
33-
.withWorkdir("/app")
34-
.withExec([path]);
31+
.withWorkdir("/app");
3532

3633
await ctr.stdout();
3734
return ctr.directory("/app/megalinter-reports").id();

0 commit comments

Comments
 (0)