Skip to content

Commit

Permalink
use Array::wrap2
Browse files Browse the repository at this point in the history
  • Loading branch information
fchastanet committed Dec 10, 2023
1 parent 7d00f00 commit 6ecef30
Show file tree
Hide file tree
Showing 65 changed files with 2,650 additions and 2,062 deletions.
1 change: 1 addition & 0 deletions .cspell/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,4 @@ difftool
apos
hpdy
tagname
Aftertabs
18 changes: 18 additions & 0 deletions .ecrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"Verbose": false,
"Debug": false,
"IgnoreDefaults": false,
"SpacesAftertabs": false,
"NoColor": false,
"Exclude": [],
"AllowedContentTypes": [],
"PassedFiles": [],
"Disable": {
"EndOfLine": false,
"Indentation": false,
"IndentSize": false,
"InsertFinalNewline": false,
"TrimTrailingWhitespace": false,
"MaxLineLength": false
}
}
16 changes: 10 additions & 6 deletions .framework-config
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
# shellcheck disable=SC2034

BASH_TOOLS_ROOT_DIR="$(cd -- "$(dirname -- "${CURRENT_LOADED_ENV_FILE}")" &>/dev/null && pwd -P)"
FRAMEWORK_ROOT_DIR="${FRAMEWORK_ROOT_DIR:-${BASH_TOOLS_ROOT_DIR}/vendor/bash-tools-framework}"
FRAMEWORK_SRC_DIR="${FRAMEWORK_SRC_DIR:-${FRAMEWORK_ROOT_DIR}/src}"
FRAMEWORK_BIN_DIR="${FRAMEWORK_BIN_DIR:-${FRAMEWORK_ROOT_DIR}/bin}"
FRAMEWORK_VENDOR_DIR="${FRAMEWORK_VENDOR_DIR:-${FRAMEWORK_ROOT_DIR}/vendor}"
FRAMEWORK_VENDOR_BIN_DIR="${FRAMEWORK_VENDOR_BIN_DIR:-${FRAMEWORK_ROOT_DIR}/vendor/bin}"
FRAMEWORK_ROOT_DIR="${BASH_TOOLS_ROOT_DIR}/vendor/bash-tools-framework"
FRAMEWORK_SRC_DIR="${FRAMEWORK_ROOT_DIR}/src"
FRAMEWORK_BIN_DIR="${FRAMEWORK_ROOT_DIR}/bin"
FRAMEWORK_VENDOR_DIR="${BASH_TOOLS_ROOT_DIR}/vendor"
FRAMEWORK_VENDOR_BIN_DIR="${FRAMEWORK_VENDOR_DIR}/bin"

# allows to generate bin file in the right directory
export BASH_TOOLS_ROOT_DIR

# compile parameters
# srcFile : file that needs to be compiled
Expand All @@ -16,7 +19,7 @@ FRAMEWORK_VENDOR_BIN_DIR="${FRAMEWORK_VENDOR_BIN_DIR:-${FRAMEWORK_ROOT_DIR}/vend
# srcDirs : additional directories where to find the functions
COMPILE_PARAMETERS=(
--src-dir "${BASH_TOOLS_ROOT_DIR}/src"
--src-dir "${FRAMEWORK_SRC_DIR}"
--src-dir "${FRAMEWORK_ROOT_DIR}/src"
--bin-dir "${BASH_TOOLS_ROOT_DIR}/bin"
--root-dir "${BASH_TOOLS_ROOT_DIR}"
--template-dir "${BASH_TOOLS_ROOT_DIR}/src"
Expand All @@ -40,6 +43,7 @@ fi

# export here all the variables that will be used in your templates
export REPOSITORY_URL="${REPOSITORY_URL:-https://github.com/fchastanet/bash-tools}"
SRC_FILE_PATH="${CURRENT_COMPILED_RELATIVE_FILE#/}"

BASH_FRAMEWORK_THEME="${BASH_FRAMEWORK_THEME:-default}"
BASH_FRAMEWORK_LOG_LEVEL="${BASH_FRAMEWORK_LOG_LEVEL:-0}"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on: # yamllint disable-line rule:truthy
- '**'
workflow_dispatch:

permissions: read-all

jobs:
build:
runs-on: ubuntu-22.04
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/precommit-autoupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
schedule:
# https://crontab.cronhub.io/
- cron: '30 10 * * *'

permissions: read-all

jobs:
auto-update:
runs-on: ubuntu-22.04
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/set-github-status-on-pr-approved.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
pull_request_review:
types: [submitted]

permissions: read-all

jobs:
build:
if: github.event.review.state == 'approved'
Expand Down
20 changes: 20 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

title = "gitleaks config"

[extend]
# useDefault will extend the base configuration with the default gitleaks config:
# https://github.com/zricethezav/gitleaks/blob/master/config/gitleaks.toml
useDefault = true

[allowlist]
description = "Allowlisted files"
paths = [
'''.automation/test''',
'''megalinter-reports''',
'''.github/linters''',
'''(.*?)/testsData/''',
'''(.*?)tests/data/''',
'''(.*?)tests/tools/data/''',
'''(.*?)gitleaks\.toml$''',
'''(.*?)(png|jpg|gif|doc|docx|pdf|bin|xls|pyc|zip)$'''
]
1 change: 1 addition & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ https://github.com/plantuml/plantuml/releases/download/v@version@/plantuml-@vers
https://github.com/docker/docker-credential-helpers/releases/download/v@version@/docker-credential-wincred-v@[email protected]*
https://github.com/Versent/saml2aws/releases/download/v@version@/saml2aws_@version@_linux_amd64.tar.gz
https://github.com/fchastanet/bash-tools/tree/master/src/_binaries*
Commands.md
3 changes: 3 additions & 0 deletions .markdown-link-check.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"ignorePatterns": [
{
"pattern": "^http://localhost:.*/"
},
{
"pattern": "^Commands.md$"
}
]
}
11 changes: 8 additions & 3 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ CREDENTIALS_SECRETLINT_CONFIG_FILE: .secretlintrc.yml
EDITORCONFIG_EDITORCONFIG_CHECKER_FILTER_REGEX_EXCLUDE: |
(?x)(
\.git/|
/testsData/.*\.(txt|help)|
/testsData/.*\.(txt|help)$|
^manualTests/data/|
^src/Log/testsData|
^Gemfile.lock$|
bin/bash-tpl|
^doc/guides/Options/generate.*\.md$|
^pages/Commands.md
^pages/Commands.md|
^.*-megalinter_file_names_cspell.txt
)
Expand All @@ -95,9 +95,14 @@ JAVASCRIPT_DEFAULT_STYLE: prettier
JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.js
JAVASCRIPT_ES_FILTER_REGEX_EXCLUDE: (report/)

JSON_JSONLINT_FILTER_REGEX_EXCLUDE: (.vscode/)
JSON_JSONLINT_FILTER_REGEX_EXCLUDE: ^\.vscode/.*\.json$

MARKDOWN_MARKDOWN_LINK_CHECK_FILTER_REGEX_EXCLUDE: (report)

SPELL_CSPELL_FILTER_REGEX_EXCLUDE: (\.git/|\.history/|IDE/.*/.idea|.*-megalinter_file_names_cspell.txt)
SPELL_FILTER_REGEX_EXCLUDE: (\.git/|\.history/|IDE/.*/.idea)

SPELL_LYCHEE_FILTER_REGEX_EXCLUDE: |
(?x)(
^pages/Commands.md$
)
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ repos:
exclude: /testsData/

- repo: https://github.com/fchastanet/bash-tools-framework
rev: 2.0.2
rev: 2.1.0
hooks:
- id: fixShebangExecutionBit
- id: fixShebangExecutionBitGithubActions
Expand Down Expand Up @@ -98,6 +98,7 @@ repos:
- id: buildShFiles
- id: buildShFilesGithubAction
- id: runUnitTests
args: [-r, src, -j, '1']
# not manual as github will run UT with several versions of bash and arch
stages: [pre-commit]
- id: megalinterCheckVersion
Expand Down
7 changes: 7 additions & 0 deletions .secretlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"rules": [
{
"id": "@secretlint/secretlint-rule-preset-recommend"
}
]
}
Loading

0 comments on commit 6ecef30

Please sign in to comment.