Skip to content

Commit

Permalink
Merge pull request #21 from tattersoftware/retool
Browse files Browse the repository at this point in the history
Retool
  • Loading branch information
MGatner committed Jul 28, 2022
2 parents 35eed15 + 5190d27 commit f269c64
Show file tree
Hide file tree
Showing 17 changed files with 326 additions and 44 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
@@ -0,0 +1,15 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = true

[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{yml,yaml}]
indent_size = 2
2 changes: 1 addition & 1 deletion .github/workflows/deptrac.yml
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
tools: phive
extensions: intl, json, mbstring, xml
coverage: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/infection.yml
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
tools: infection, phpunit
extensions: intl, json, mbstring, gd, xml, sqlite3
coverage: xdebug
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpcpd.yml
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
tools: phpcpd
extensions: dom, mbstring
coverage: none
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/phpcsfixer.yml
Expand Up @@ -16,13 +16,9 @@ on:

jobs:
build:
name: PHP ${{ matrix.php-versions }} Coding Standards
name: Coding Standards
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0', '8.1']

steps:
- name: Checkout
Expand All @@ -31,7 +27,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
php-version: '8.1'
extensions: json, tokenizer
coverage: none
env:
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/psalm.yml
@@ -0,0 +1,71 @@
name: Psalm

on:
pull_request:
branches:
- develop
paths:
- '**.php'
- 'composer.*'
- 'psalm*'
- '.github/workflows/psalm.yml'
push:
branches:
- develop
paths:
- '**.php'
- 'composer.*'
- 'psalm*'
- '.github/workflows/psalm.yml'

jobs:
build:
name: Psalm Analysis
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: phpstan, phpunit
extensions: intl, json, mbstring, xml
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Create Psalm cache directory
run: mkdir -p build/psalm

- name: Cache Psalm results
uses: actions/cache@v3
with:
path: build/psalm
key: ${{ runner.os }}-psalm-${{ github.sha }}
restore-keys: ${{ runner.os }}-psalm-

- name: Install dependencies
run: |
if [ -f composer.lock ]; then
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
else
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
fi
- name: Run Psalm analysis
run: vendor/bin/psalm
2 changes: 1 addition & 1 deletion .github/workflows/rector.yml
Expand Up @@ -63,5 +63,5 @@ jobs:
- name: Analyze for refactoring
run: |
composer global require --dev rector/rector:^0.12.16
composer global require --dev rector/rector:^0.13.8
rector process --dry-run --no-progress-bar
2 changes: 1 addition & 1 deletion .github/workflows/unused.yml
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
tools: composer, composer-unused
extensions: intl, json, mbstring, xml
coverage: none
Expand Down
16 changes: 7 additions & 9 deletions composer-unused.php
Expand Up @@ -7,12 +7,10 @@
use ComposerUnused\ComposerUnused\Configuration\PatternFilter;
use Webmozart\Glob\Glob;

return static function (Configuration $config): Configuration {
return $config
->addNamedFilter(NamedFilter::fromString('components/jquery'))
->addNamedFilter(NamedFilter::fromString('tatter/assets'))
->addNamedFilter(NamedFilter::fromString('twbs/bootstrap'))
->setAdditionalFilesFor('codeigniter4/framework', [
...Glob::glob(__DIR__ . '/vendor/codeigniter4/framework/system/Helpers/*.php'),
]);
};
return static fn (Configuration $config): Configuration => $config
->addNamedFilter(NamedFilter::fromString('components/jquery'))
->addNamedFilter(NamedFilter::fromString('tatter/assets'))
->addNamedFilter(NamedFilter::fromString('twbs/bootstrap'))
->setAdditionalFilesFor('codeigniter4/framework', [
...Glob::glob(__DIR__ . '/vendor/codeigniter4/framework/system/Helpers/*.php'),
]);
38 changes: 21 additions & 17 deletions composer.json
@@ -1,15 +1,14 @@
{
"name": "tatter/chat",
"type": "library",
"description": "Embedded chat widget for CodeIgniter 4",
"license": "MIT",
"type": "library",
"keywords": [
"codeigniter",
"codeigniter4",
"chat",
"bootstrap"
],
"homepage": "https://github.com/tattersoftware/codeigniter4-chat",
"license": "MIT",
"authors": [
{
"name": "Matthew Gatner",
Expand All @@ -18,6 +17,7 @@
"role": "Developer"
}
],
"homepage": "https://github.com/tattersoftware/codeigniter4-chat",
"require": {
"php": "^7.4 || ^8.0",
"codeigniter4/authentication-implementation": "1.0",
Expand All @@ -32,12 +32,14 @@
"myth/auth": "dev-develop",
"tatter/tools": "^2.0"
},
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true,
"phpstan/extension-installer": true
"repositories": [
{
"type": "vcs",
"url": "https://github.com/lonnieezell/myth-auth"
}
},
],
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Tatter\\Chat\\": "src"
Expand All @@ -51,23 +53,25 @@
"Tests\\Support\\": "tests/_support"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/lonnieezell/myth-auth"
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true,
"phpstan/extension-installer": true
}
],
"minimum-stability": "dev",
"prefer-stable": true,
},
"scripts": {
"analyze": "phpstan analyze",
"analyze": [
"phpstan analyze",
"psalm",
"rector process --dry-run"
],
"ci": [
"Composer\\Config::disableProcessTimeout",
"@deduplicate",
"@analyze",
"@composer normalize --dry-run",
"@test",
"@inspect",
"rector process",
"@style"
],
"deduplicate": "phpcpd app/ src/",
Expand Down

0 comments on commit f269c64

Please sign in to comment.