forked from OS2Forms/os2forms_get_organized
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
388 additions
and
238 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,25 @@ | ||
#### Link to ticket | ||
|
||
Please add a link to the ticket being addressed by this change. | ||
|
||
#### Description | ||
|
||
Please include a short description of the suggested change and the reasoning behind the approach you have chosen. | ||
|
||
#### Screenshot of the result | ||
|
||
If your change affects the user interface you should include a screenshot of the result with the pull request. | ||
|
||
#### Checklist | ||
|
||
- [ ] My code is covered by test cases. | ||
- [ ] My code passes our test (all our tests). | ||
- [ ] My code passes our static analysis suite. | ||
- [ ] My code passes our continuous integration process. | ||
|
||
If your code does not pass all the requirements on the checklist you have to add a comment explaining why this change | ||
should be exempt from the list. | ||
|
||
#### Additional comments or questions | ||
|
||
If you have any further comments or questions for the reviewer please add them here. |
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,13 @@ | ||
{ | ||
"default": true, | ||
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md | ||
"line-length": { | ||
"line_length": 120, | ||
"code_blocks": false, | ||
"tables": false | ||
}, | ||
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md | ||
"no-duplicate-heading": { | ||
"siblings_only": true | ||
} | ||
} |
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 |
---|---|---|
@@ -1,61 +1,64 @@ | ||
{ | ||
"name": "os2forms/os2forms_get_organized", | ||
"description": "OS2Forms GetOrganized integration", | ||
"type": "drupal-module", | ||
"license": "MIT", | ||
"type": "drupal-module", | ||
"authors": [ | ||
{ | ||
"name": "Jeppe Kuhlmann Andersen", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"repositories": [ | ||
{ | ||
"type": "composer", | ||
"url": "https://packages.drupal.org/8" | ||
} | ||
], | ||
"require": { | ||
"itk-dev/getorganized-api-client-php": "^1.2", | ||
"drupal/webform": "^6.1", | ||
"drupal/advancedqueue": "^1.0", | ||
"symfony/options-resolver": "^5.4", | ||
"os2forms/os2forms": "^3.13" | ||
"drupal/key": "^1.17", | ||
"drupal/webform": "^6.1", | ||
"itk-dev/getorganized-api-client-php": "^1.2", | ||
"os2forms/os2forms": "^3.13", | ||
"symfony/options-resolver": "^5.4" | ||
}, | ||
"require-dev": { | ||
"dealerdirect/phpcodesniffer-composer-installer": "^1.0", | ||
"drupal/coder": "^8.3", | ||
"ergebnis/composer-normalize": "^2.42", | ||
"mglaman/drupal-check": "^1.4" | ||
}, | ||
"repositories": [ | ||
{ | ||
"type": "composer", | ||
"url": "https://packages.drupal.org/8" | ||
} | ||
], | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"config": { | ||
"allow-plugins": { | ||
"cweagans/composer-patches": true, | ||
"dealerdirect/phpcodesniffer-composer-installer": true, | ||
"ergebnis/composer-normalize": true, | ||
"simplesamlphp/composer-module-installer": true, | ||
"zaporylie/composer-drupal-optimizations": true | ||
} | ||
}, | ||
"scripts": { | ||
"code-analysis": [ | ||
"@code-analysis/drupal-check" | ||
], | ||
"code-analysis/drupal-check": [ | ||
"# @see https://github.com/mglaman/drupal-check/issues/261#issuecomment-1030141772 for details on exclude-dir value", | ||
"drupal-check --deprecations --analysis --exclude-dir='vendor,*/Client/*' *.* src" | ||
], | ||
"code-analysis": [ | ||
"@code-analysis/drupal-check" | ||
"coding-standards-apply": [ | ||
"@coding-standards-apply/phpcs" | ||
], | ||
"coding-standards-check/phpcs": [ | ||
"vendor/bin/phpcs --standard=phpcs.xml.dist" | ||
"coding-standards-apply/phpcs": [ | ||
"vendor/bin/phpcbf --standard=phpcs.xml.dist" | ||
], | ||
"coding-standards-check": [ | ||
"@coding-standards-check/phpcs" | ||
], | ||
"coding-standards-apply/phpcs": [ | ||
"vendor/bin/phpcbf --standard=phpcs.xml.dist" | ||
], | ||
"coding-standards-apply": [ | ||
"@coding-standards-apply/phpcs" | ||
"coding-standards-check/phpcs": [ | ||
"vendor/bin/phpcs --standard=phpcs.xml.dist" | ||
] | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"dealerdirect/phpcodesniffer-composer-installer": true, | ||
"zaporylie/composer-drupal-optimizations": true, | ||
"cweagans/composer-patches": true, | ||
"simplesamlphp/composer-module-installer": true | ||
} | ||
} | ||
} |
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,6 @@ | ||
services: | ||
Drupal\os2forms_get_organized\Drush\Commands\GetOrganizedTestCommands: | ||
arguments: | ||
- '@Drupal\os2forms_get_organized\Helper\ArchiveHelper' | ||
tags: | ||
- { name: drush.command } |
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,11 @@ | ||
parameters: | ||
level: 6 | ||
paths: | ||
- src | ||
|
||
ignoreErrors: | ||
- '#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,48 @@ | ||
#!/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 all module files not ignored by git into module path | ||
# (cf. https://stackoverflow.com/a/77197460) | ||
for f in $(git ls-files --cached --others --exclude-standard); 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/$module_path" && ../../../../vendor/bin/phpstan) |
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,38 @@ | ||
<?php | ||
|
||
namespace Drupal\os2forms_get_organized\Drush\Commands; | ||
|
||
use Drupal\os2forms_get_organized\Helper\ArchiveHelper; | ||
use Drush\Commands\DrushCommands; | ||
|
||
/** | ||
* Test commands for get organized. | ||
*/ | ||
class GetOrganizedTestCommands extends DrushCommands { | ||
|
||
/** | ||
* Constructor. | ||
*/ | ||
public function __construct( | ||
private readonly ArchiveHelper $helper, | ||
) { | ||
} | ||
|
||
/** | ||
* Test API access. | ||
* | ||
* @command os2forms-get-organized:test:api | ||
* @usage os2forms-get-organized:test:api --help | ||
*/ | ||
public function testApi(): void { | ||
try { | ||
$this->helper->pingApi(); | ||
$this->io()->success('Successfully connected to Get Organized API'); | ||
} | ||
catch (\Throwable $t) { | ||
$this->io()->error($t->getMessage()); | ||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.