Skip to content

Commit

Permalink
Added project code.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Mar 21, 2023
1 parent 58b9dde commit 5fab19b
Show file tree
Hide file tree
Showing 12 changed files with 1,160 additions and 5 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: echo "Would run tests"
- uses: actions/cache@v3
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- uses: php-actions/composer@v6
- run: composer lint
- run: composer test
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,26 @@ Scan a file or a directory with shell scripts and extract all variables.

## Usage

vendor/bin/shell-variables-extractor
Variables can have descriptions and default values that will be printed out
to the STDOUT in the CSV format as `name, default_value, description`.

This is helpful to maintain a table of variables and their descriptions in
documentation.

./extract-shell-variables.php path/to/file1 path/to/file2
./extract-shell-variables.php path/to/dir

With excluded file:

./extract-shell-variables.php -e ../excluded.txt path/to/file

Full:

./extract-shell-variables.php -t -m -e ./excluded.txt -u "<NOT SET>" ../

## Maintenance

composer install
composer lint
composer lint:fix
composer test
14 changes: 11 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@
"issues": "https://github.com/drevops/shell-variables-extractor/issues",
"source": "https://github.com/drevops/shell-variables-extractor"
},
"require": {},
"scripts": {
"lint": "echo Would run code lint",
"test": "echo Would run tests"
"lint": "vendor/bin/phpcs -s --standard=Drupal extract-shell-variables.php",
"lint:fix": "vendor/bin/phpcbf -s --standard=Drupal extract-shell-variables.php",
"test": "cd ./tests && ./test.sh"
},
"require-dev": {
"drupal/coder": "^8.3"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}

0 comments on commit 5fab19b

Please sign in to comment.