-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Defined coding standards and applied in select places
- Loading branch information
Showing
14 changed files
with
248 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
// @see https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.jsonc | ||
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md | ||
"MD013": { | ||
// Exclude code blocks | ||
"code_blocks": false, | ||
"line_length": 120 | ||
}, | ||
|
||
// Prevent complaining on duplicated headings in CHANGELOG.md | ||
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md | ||
"MD024": { | ||
"siblings_only": true | ||
} | ||
} | ||
|
||
// Local Variables: | ||
// mode: json | ||
// End: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ruleset name="PHP_CodeSniffer"> | ||
<description>OS2Forms PHP Code Sniffer configuration</description> | ||
|
||
<file>.</file> | ||
<exclude-pattern>vendor/</exclude-pattern> | ||
<exclude-pattern>node_modules/</exclude-pattern> | ||
|
||
<!-- Show progress of the run --> | ||
<arg value="p"/> | ||
|
||
<arg name="extensions" value="php,module,inc,install,test,profile,theme,css,info,txt,yml"/> | ||
<config name="drupal_core_version" value="9"/> | ||
|
||
<rule ref="Drupal"> | ||
<!-- We want to be able to use "package" and "version" in our custom modules --> | ||
<exclude name="Drupal.InfoFiles.AutoAddedKeys.Project"/> | ||
<exclude name="Drupal.InfoFiles.AutoAddedKeys.Version"/> | ||
</rule> | ||
|
||
<rule ref="DrupalPractice"/> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
parameters: | ||
level: 6 | ||
paths: | ||
- src | ||
|
||
ignoreErrors: | ||
- "#Method [a-zA-Z0-9\\_\\\\:\\(\\)]+ has parameter \\$[a-zA-Z0-9_]+ with no value type specified in iterable type array#" | ||
- "#Method [a-zA-Z0-9\\_\\\\:\\(\\)]+ return type has no value type specified in iterable type array#" | ||
- '#Unsafe usage of new static\(\).#' | ||
|
||
# Local Variables: | ||
# mode: yaml | ||
# End: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
script_dir=$(pwd) | ||
module_name=$(basename "$script_dir") | ||
drupal_dir=vendor/drupal-module-code-analysis | ||
# Relative to $drupal_dir | ||
module_path=web/modules/contrib/$module_name | ||
|
||
cd "$script_dir" || exit | ||
|
||
drupal_composer() { | ||
composer --working-dir="$drupal_dir" --no-interaction "$@" | ||
} | ||
|
||
# # Create new Drupal 9 project | ||
# if [ ! -f "$drupal_dir/composer.json" ]; then | ||
# composer --no-interaction create-project drupal/recommended-project:^9 "$drupal_dir" | ||
# fi | ||
# # Copy our code into the modules folder | ||
|
||
# # Clean up | ||
# rm -fr "${drupal_dir:?}/$module_path" | ||
|
||
# # https://stackoverflow.com/a/15373763 | ||
# # rsync --archive --compress . --filter=':- .gitignore' --exclude "$drupal_dir" --exclude .git "$drupal_dir/$module_path" | ||
|
||
# # The rsync command in not available in itkdev/php8.1-fpm | ||
|
||
# git config --global --add safe.directory /app | ||
# # Copy module files into module path | ||
# for f in $(git ls-files); do | ||
# mkdir -p "$drupal_dir/$module_path/$(dirname "$f")" | ||
# cp "$f" "$drupal_dir/$module_path/$f" | ||
# done | ||
|
||
# drupal_composer config minimum-stability dev | ||
|
||
# # Allow ALL plugins | ||
# # https://getcomposer.org/doc/06-config.md#allow-plugins | ||
# drupal_composer config --no-plugins allow-plugins true | ||
|
||
# drupal_composer require wikimedia/composer-merge-plugin | ||
# drupal_composer config extra.merge-plugin.include "$module_path/composer.json" | ||
# # https://www.drupal.org/project/drupal/issues/3220043#comment-14845434 | ||
# drupal_composer require --dev symfony/phpunit-bridge | ||
|
||
# Run PHPStan | ||
(cd "$drupal_dir" && vendor/bin/phpstan --configuration="$module_path/phpstan.neon") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.