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 11, 2023
1 parent 7d00f00 commit f6bfd01
Show file tree
Hide file tree
Showing 74 changed files with 2,867 additions and 2,073 deletions.
8 changes: 8 additions & 0 deletions .cspell/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,11 @@ difftool
apos
hpdy
tagname
Aftertabs
GKHF
cyclonedx
cpes
UNINDEXED
unindexed
logrus
JSONLINT
20 changes: 20 additions & 0 deletions .ecrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"Verbose": false,
"Debug": false,
"IgnoreDefaults": false,
"SpacesAftertabs": false,
"NoColor": false,
"Exclude": [
"/testsData/"
],
"AllowedContentTypes": [],
"PassedFiles": [],
"Disable": {
"EndOfLine": false,
"Indentation": false,
"IndentSize": false,
"InsertFinalNewline": false,
"TrimTrailingWhitespace": false,
"MaxLineLength": false
}
}
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[.vscode/*.json]
indent_size = unset
18 changes: 17 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,21 @@ module.exports = {
commonjs: true,
node: true,
},
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
plugins: ['json'],
extends: [
'eslint:recommended',
'plugin:json/recommended',
'eslint-config-prettier',
],
rules: {
'json/*': ['error', {allowComments: false}],
},
overrides: [
{
files: ['.vscode/*.json'],
rules: {
'json/*': ['error', {allowComments: true}],
},
},
],
};
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
1 change: 1 addition & 0 deletions .github/workflows/docsify-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Docker Buildx
# kics-scan ignore-line
uses: docker/setup-buildx-action@v3

- name: docker pull image
Expand Down
17 changes: 17 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 Expand Up @@ -55,17 +57,21 @@ jobs:
runPrecommitTests: false
steps:
- name: Checkout
# kics-scan ignore-line
uses: actions/checkout@v4

- name: Set up Docker Buildx
# kics-scan ignore-line
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
# kics-scan ignore-line
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# kics-scan ignore-line
- uses: ouzi-dev/commit-status-updater@v2
with:
name: build bash-tools-${{matrix.vendor}}-${{matrix.bashTarVersion}}
Expand All @@ -74,6 +80,7 @@ jobs:
# only if pre-commit
- name: Set up Python
if: matrix.runPrecommitTests
# kics-scan ignore-line
uses: actions/setup-python@v4
with:
python-version: 3.9
Expand All @@ -82,6 +89,7 @@ jobs:
if: matrix.runPrecommitTests
run: pip install pre-commit

# kics-scan ignore-line
- uses: ouzi-dev/commit-status-updater@v2
if: matrix.runPrecommitTests
with:
Expand All @@ -95,6 +103,7 @@ jobs:
- name: Archive results
if: matrix.runPrecommitTests && always()
continue-on-error: true
# kics-scan ignore-line
uses: actions/upload-artifact@v3
with:
name: linter-reports
Expand All @@ -103,6 +112,7 @@ jobs:
- name: Create Pull Request
if: matrix.runPrecommitTests && failure()
# kics-scan ignore-line
uses: peter-evans/create-pull-request@v5
with:
branch: update/pre-commit-fixes
Expand All @@ -112,6 +122,7 @@ jobs:
some auto fixes have been generated during pre-commit run
labels: updates

# kics-scan ignore-line
- uses: ouzi-dev/commit-status-updater@v2
if: matrix.runPrecommitTests && always()
with:
Expand Down Expand Up @@ -139,11 +150,13 @@ jobs:
- name: Upload Test Results
if: always()
# kics-scan ignore-line
uses: actions/upload-artifact@v3
with:
name: Test Results ${{matrix.vendor}} ${{matrix.bashTarVersion}}
path: logs/report.xml

# kics-scan ignore-line
- uses: ouzi-dev/commit-status-updater@v2
if: always()
with:
Expand All @@ -165,19 +178,23 @@ jobs:
pull-requests: write
steps:
- name: Download Artifacts
# kics-scan ignore-line
uses: actions/download-artifact@v3
with:
path: artifacts

- name: Checkstyle aggregation
# kics-scan ignore-line
uses: lcollins/[email protected]
with:
path: 'artifacts/**/*.xml'

# run this action to get the workflow conclusion
# You can get the conclusion via env (env.WORKFLOW_CONCLUSION)
# kics-scan ignore-line
- uses: technote-space/workflow-conclusion-action@v3

# kics-scan ignore-line
- uses: ouzi-dev/commit-status-updater@v2
with:
name: build
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/precommit-autoupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ on:
schedule:
# https://crontab.cronhub.io/
- cron: '30 10 * * *'

permissions: read-all

jobs:
auto-update:
runs-on: ubuntu-22.04
steps:
# kics-scan ignore-line
- uses: actions/checkout@v4

- name: Set up Python
# kics-scan ignore-line
uses: actions/setup-python@v4
with:
python-version: 3.9
Expand All @@ -25,6 +30,7 @@ jobs:
run: pre-commit autoupdate

- name: Create Pull Request
# kics-scan ignore-line
uses: peter-evans/create-pull-request@v5
with:
branch: update/pre-commit-autoupdate
Expand Down
4 changes: 4 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,13 +6,17 @@ on:
pull_request_review:
types: [submitted]

permissions: read-all

jobs:
build:
if: github.event.review.state == 'approved'
runs-on: ubuntu-22.04
steps:
# kics-scan ignore-line
- uses: actions/checkout@v4
- name: Run the action # You would run your tests before this using the output to set state/desc
# kics-scan ignore-line
uses: Sibz/github-status-action@v1
with:
authToken: ${{secrets.GITHUB_TOKEN}}
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ bin/runBuildContainer
/bin/test
/bin/buildPushDockerImages
/bin/buildPushDockerImage

# node modules
node_modules/
package*.json
yarn.lock
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)$'''
]
Loading

0 comments on commit f6bfd01

Please sign in to comment.