Skip to content

Commit

Permalink
fix all binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
fchastanet committed Nov 7, 2023
1 parent 94097d9 commit 73e61e1
Show file tree
Hide file tree
Showing 100 changed files with 6,770 additions and 4,640 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
".jscpd.json",
".mega-linter.yml",
".shellcheckrc",
".env"
".env",
"**/*.help.txt"
],
"noConfigSearch": true,
"words": ["megalinter", "oxsecurity"],
Expand Down
4 changes: 4 additions & 0 deletions .cspell/bash.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,7 @@ Chastanet
Scrasnups
datetime
gensub
hlocalhost
uuser
ppassword
DELIMS
5 changes: 5 additions & 0 deletions .cspell/softwares.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,8 @@ docsify
htmlhintrc
gitleaks
nojekyll
RUBOCOP
TRIVY
KICS
TRUFFLEHOG
GRYPE
6 changes: 3 additions & 3 deletions .framework-config
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# shellcheck disable=SC2034

# describe the functions that will be skipped from being imported
FRAMEWORK_FUNCTIONS_IGNORE_REGEXP='^namespace::functions$|^Functions::myFunction$|^IMPORT::dir::file$|^Acquire::ForceIPv4$'
FRAMEWORK_FUNCTIONS_IGNORE_REGEXP='^(Namespace::functions|Functions::myFunction|Namespace::requireSomething|IMPORT::dir::file|Acquire::ForceIPv4)$'
# describe the files that do not contain function to be imported
NON_FRAMEWORK_FILES_REGEXP="(^bin/|.framework-config|^install$|.bats$|/testsData/|^manualTests/|/_.sh$|/ZZZ.sh$|/__all.sh$|^src/_binaries|^src/_includes|^src/batsHeaders.sh$|^conf)"
# describe the files that are allowed to not have an associated bats file
BATS_FILE_NOT_NEEDED_REGEXP="(^bin/|.framework-config|^install$|.bats$|/testsData/|^manualTests/|/_.sh$|/ZZZ.sh$|/__all.sh$|^src/batsHeaders.sh$)"
BATS_FILE_NOT_NEEDED_REGEXP="(^bin/|.framework-config|^install$|.bats$|/testsData/|^manualTests/|/_.sh$|/ZZZ.sh$|/__all.sh$|^src/batsHeaders.sh$|^src/_includes)"
# describe the files that are allowed to not have a function matching the filename
FRAMEWORK_FILES_FUNCTION_MATCHING_IGNORE_REGEXP="^conf/|^bin/|^\.framework-config$|^build.sh$|\.tpl$|testsData/binaryFile$"
# Source directories
FRAMEWORK_SRC_DIRS=(
"${BASH_TOOLS_ROOT_DIR}/src"
"${FRAMEWORK_ROOT_DIR}/src"
"${FRAMEWORK_ROOT_DIR}/vendor/bash-tools-framework/src"
)

Expand Down
2 changes: 2 additions & 0 deletions .jscpd.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
"**/.history/**",
"**/bin/**",
"**/backup/**",
"**/logs/**",
"**/megalinter-reports/**",
"conf/localAppData/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/LocalState/originalSettings.json",
"vendor/bash-tools-framework/**",
"vendor/bash-tools-framework/.cspell/*",
"src/_binaries/DbImport/dbImportProfile.options.tpl",
"testsData/**",
"vendor/bats*/**",
"pages/README.md",
Expand Down
17 changes: 17 additions & 0 deletions .mega-linter-light.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
EXTENDS:
- .mega-linter.yml
DISABLE_LINTERS:
- JAVASCRIPT_ES
- JAVASCRIPT_PRETTIER
- RUBY_RUBOCOP
- REPOSITORY_CHECKOV
- REPOSITORY_TRIVY
- REPOSITORY_KICS
- SPELL_VALE
- SPELL_LYCHEE
- SPELL_PROSELINT
# REPOSITORY_TRUFFLEHOG disabled because too slow
- REPOSITORY_TRUFFLEHOG
# REPOSITORY_GRYPE disabled because too slow
- REPOSITORY_GRYPE
56 changes: 49 additions & 7 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,67 @@ DISABLE_LINTERS:
- TERRAFORM_CHECKOV
- REPOSITORY_CHECKOV
- REPOSITORY_TRIVY
- REPOSITORY_KICS
- SPELL_VALE
- SPELL_LYCHEE
- SPELL_PROSELINT
# DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass
EXCLUDED_DIRECTORIES:
- '.history'
- '.git'
- '.idea'
FILTER_REGEX_EXCLUDE: (\.git/|\.history/|\.idea/)
- 'logs'
FILTER_REGEX_EXCLUDE: |
(?x)(
\.git/|
\.history/|
\.idea/|
^vendor/
)
FILEIO_REPORTER: false
PRE_COMMANDS:
- command: env
cwd: 'workspace'
POST_COMMANDS:
# FIX files set as root user
# HOST_USER_ID and HOST_GROUP_ID set in package.json
- command: find . -user 0 -exec chown ${HOST_USER_ID}:${HOST_GROUP_ID} {} ';'
- command: |
if [[ "{HOST_USER_ID:-0}" != "0" && "{HOST_GROUP_ID:-0}" != "0" ]]; then
find . -user 0 -exec chown ${HOST_USER_ID}:${HOST_GROUP_ID} {} ';'
fi
cwd: 'workspace'
# remove files generated by cspell
- command: find . -name '*megalinter_file_names_cspell.txt' -delete
cwd: 'workspace'

PRINT_ALPACA: false
SHOW_ELAPSED_TIME: true

# Linters configurations
BASH_SHELLCHECK_FILTER_REGEX_EXCLUDE: (vendor/.*)
BASH_SHELLCHECK_FILTER_REGEX_EXCLUDE: |
(?x)(
^vendor|
/testsData/
)
BASH_SHELLCHECK_ARGUMENTS: --source-path=/tmp/lint

BASH_SHFMT_ARGUMENTS: -i 2 -ci
BASH_SHFMT_FILTER_REGEX_EXCLUDE: .\.zsh$|/\.zshrc|^src/.*/testsData/.*$|^Gemfile.lock$
BASH_SHFMT_FILTER_REGEX_EXCLUDE: .\.zsh$|/\.zshrc|/testsData/|^Gemfile.lock$

CREDENTIALS_SECRETLINT_CONFIG_FILE: .secretlintrc.yml

EDITORCONFIG_EDITORCONFIG_CHECKER_FILTER_REGEX_EXCLUDE: \.git|^src/.*/testsData/.*$|^Gemfile.lock$
EDITORCONFIG_EDITORCONFIG_CHECKER_FILTER_REGEX_EXCLUDE: |
(?x)(
\.git/|
/testsData/.*\.(txt|help)|
^manualTests/data/|
^src/Log/testsData|
^Gemfile.lock$|
bin/bash-tpl|
^doc/guides/Options/generate.*\.md$|
^pages/Commands.md
^.*-megalinter_file_names_cspell.txt
)
GIT_GIT_DIFF_PRE_COMMANDS:
- command: git config --global core.autocrlf input
Expand All @@ -50,14 +83,23 @@ GIT_GIT_DIFF_PRE_COMMANDS:
continue_if_failed: false
- command: git config --global core.whitespace cr-at-eol,-trailing-space
continue_if_failed: false
- command: git config --global core.excludesfile .gitignore
continue_if_failed: false
- command: git config --global --add safe.directory .git
continue_if_failed: false

IGNORE_GITIGNORED_FILES: true
IGNORE_GENERATED_FILES: true

JAVASCRIPT_DEFAULT_STYLE: prettier
JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.js
JAVASCRIPT_ES_FILTER_REGEX_EXCLUDE: (report/)

JSON_JSONLINT_FILTER_REGEX_EXCLUDE: (\.vscode/settings\.json|conf/\.vscode/settings\.json|report|.vscode/launch.json)
JSON_JSONLINT_FILTER_REGEX_EXCLUDE: |
(?x)(
^\.vscode/(settings|launch)\.json|
^conf/\.vscode/settings\.json
)
MARKDOWN_MARKDOWN_LINK_CHECK_FILTER_REGEX_EXCLUDE: (report)

Expand Down
71 changes: 56 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
always_run: true
require_serial: true
fail_fast: true
verbose: true
stages: [commit]

- repo: local
hooks:
Expand All @@ -18,46 +18,63 @@ repos:
entry: bash -c './bin/findShebangFiles chmod +x'
language: system
always_run: true
require_serial: true
fail_fast: true
verbose: true
stages: [commit]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: mixed-line-ending
stages: [commit]
- id: end-of-file-fixer
stages: [commit]
- id: check-executables-have-shebangs
stages: [commit]
- id: check-shebang-scripts-are-executable
stages: [commit]
- id: check-xml
stages: [commit]
- id: check-yaml
stages: [commit]
- id: forbid-new-submodules
stages: [commit]
- id: mixed-line-ending
args: [--fix=lf]
stages: [commit]
- id: check-json
exclude: |
(?x)^(
conf\/.vscode\/settings.json|
.vscode\/launch.json
)$
stages: [commit]

- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: shfmt
args: [-i, '2', -ci]
exclude: /testsData/
exclude: |
(?x)(
/testsData/|
^bin/|
^conf/dbScripts/|
^install
)
stages: [commit]

# Check both committed and uncommitted files for git conflict
# markers and whitespace errors according to core.whitespace
# and conflict-marker-size configuration in a git repo.
- id: git-check
exclude: /testsData/
stages: [commit]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
hooks:
- id: prettier
stages: [commit]

- repo: local
hooks:
Expand All @@ -66,21 +83,18 @@ repos:
entry: bash -c './bin/shellcheckLint --staged -f tty'
language: system
always_run: true
require_serial: true
fail_fast: true
verbose: true
stages: [commit]

- repo: local
hooks:
- id: frameworkLint
name: frameworkLint
entry: bash -c './bin/frameworkLint --verbose'
entry: |
bash -c './bin/frameworkLint --verbose --expected-warnings-count 6'
language: system
always_run: true
require_serial: true
fail_fast: true
verbose: true
stages: [commit]

- repo: local
Expand All @@ -92,7 +106,7 @@ repos:
always_run: true
require_serial: true
fail_fast: true
verbose: true
stages: [commit]

- repo: local
hooks:
Expand All @@ -103,7 +117,7 @@ repos:
always_run: true
require_serial: true
fail_fast: true
verbose: true
stages: [push]

- repo: local
hooks:
Expand All @@ -114,15 +128,42 @@ repos:
always_run: true
require_serial: true
fail_fast: true
verbose: true
stages: [commit]

- repo: local
hooks:
- id: megalinter-check-version
name: megalinter-check-version
language: system
entry: ./bin/megalinter
args:
[
--image,
'oxsecurity/megalinter-terraform:v7.5.0',
--check-megalinter-version,
]
pass_filenames: false
always_run: true
fail_fast: true
stages: [push]

- repo: local
hooks:
- id: megalinter
name: megalinter
entry: bash -c './bin/megalinter --incremental --fix'
language: system
always_run: true
entry: ./bin/megalinter
args:
[
--image,
'oxsecurity/megalinter-terraform:v7.5.0',
--config-file,
'.mega-linter-light.yml',
--fix,
]
pass_filenames: false
require_serial: true
always_run: true
fail_fast: true
verbose: true
stages: [push]
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"files.exclude": {
"**/.git": true
},
"workbench.editorAssociations": {
"*.md": "default"
},
"explorer.autoReveal": false,
"markdown.extension.toc.omittedFromToc": {
"*.md": ["# %%"]
Expand Down
6 changes: 3 additions & 3 deletions Commands.tmpl.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- [1.11. .github/workflows/buildBinFiles](#111-githubworkflowsbuildbinfiles)
- [1.12. bin/test](#112-bintest)
- [1.13. bin/runBuildContainer](#113-binrunbuildcontainer)
- [1.14. bin/buildPushDockerImages](#114-binbuildpushdockerimages)
- [1.14. bin/buildPushDockerImage](#114-binbuildpushdockerimage)
- [2. Converter and Generator tools](#2-converter-and-generator-tools)
- [2.1. bin/generateShellDoc](#21-bingenerateshelldoc)
- [2.2. bin/mysql2puml](#22-binmysql2puml)
Expand Down Expand Up @@ -141,12 +141,12 @@ imported from bash-tools-framework
@@@runBuildContainer_help@@@
```

### 1.14. bin/buildPushDockerImages
### 1.14. bin/buildPushDockerImage

imported from bash-tools-framework

```text
@@@buildPushDockerImages_help@@@
@@@buildPushDockerImage_help@@@
```

## 2. Converter and Generator tools
Expand Down
Loading

0 comments on commit 73e61e1

Please sign in to comment.