Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into ignores-list-inspection-by-name
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Jul 3, 2024
2 parents 889073b + 3287ea0 commit 687f733
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 42 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

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

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
10 changes: 8 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
version: 2
updates:
# Enable version updates for composer
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "daily"
interval: "daily"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
16 changes: 8 additions & 8 deletions .github/workflows/code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
jobs:
code_analysis_composer:
timeout-minutes: 30
name: ${{ matrix.actions.name }} on PHP ${{ matrix.php }}
name: '${{ matrix.actions.name }} on PHP ${{ matrix.php }}'
runs-on: ubuntu-latest
strategy:
fail-fast : false
fail-fast: false
matrix:
php: ['8.2']
php: [ '8.2', '8.3' ]

actions:
- name: ECS
Expand All @@ -27,21 +27,21 @@ jobs:
run: "composer validate"

env:
APP_NAME : "Worksome CI"
APP_ENV : testing
APP_NAME: "Worksome CI"
APP_ENV: testing

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php }}
tools: composer, cs2pr
tools: cs2pr

- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3

- run: ${{ matrix.actions.run }}
20 changes: 10 additions & 10 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Auto-merge Dependabot PRs for semver-minor updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' }}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Auto-merge Dependabot PRs for semver-patch updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 5 additions & 3 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Fetch version
id: version
Expand Down Expand Up @@ -41,12 +41,14 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2

- name: Download Box Phar
run: wget https://github.com/box-project/box/releases/latest/download/box.phar && chmod 755 box.phar

- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
composer-options: "--no-dev"

Expand All @@ -56,4 +58,4 @@ jobs:
- name: Upload phar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ steps.version.outputs.version }} build/graphlint || true
run: gh release upload ${{ steps.version.outputs.version }} build/graphlint || true
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ 8.2 ]
php: [ '8.2', '8.3' ]
laravel: [ 10.* ]
stability: [ prefer-lowest, prefer-stable ]

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ jobs:
steps:

- name: Generate App Token
uses: tibdex/github-app-token@v1
uses: tibdex/github-app-token@v2
id: generate_token
with:
private_key: ${{ secrets.WORKSOME_INTERNAL_PRIVATE_KEY }}
app_id: ${{ secrets.WORKSOME_INTERNAL_APP_ID }}
repository: worksome/homebrew-tap
installation_retrieval_mode: repository
installation_retrieval_payload: worksome/homebrew-tap

- name: Get version
id: version
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.10.0
v0.11.3
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"jawira/case-converter": "^3.5"
},
"require-dev": {
"pestphp/pest": "^2.0",
"symfony/var-dumper": "^6.0",
"pestphp/pest": "^2.34",
"symfony/var-dumper": "^6.4",
"symplify/easy-testing": "^11.0",
"worksome/coding-style": "^2.5"
"worksome/coding-style": "^2.10.2"
},
"license": "MIT",
"autoload": {
Expand Down
1 change: 0 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
SetList::PHP_80,
SetList::PHP_74,
SetList::EARLY_RETURN,
SetList::PSR_4,
]);

// Register extra a single rules
Expand Down
12 changes: 5 additions & 7 deletions src/Commands/AnalyseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use GraphQL\Error\SyntaxError;
use GraphQL\Language\Parser;
use JsonException;
use Safe\Exceptions\FilesystemException;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
Expand All @@ -31,7 +32,7 @@ class AnalyseCommand extends Command

protected static $defaultName = 'analyse';

protected static $defaultDescription = 'Analyses a graphql file';
protected static $defaultDescription = 'Analyse a GraphQL file';

protected function configure(): void
{
Expand All @@ -49,22 +50,19 @@ protected function configure(): void
self::INPUT,
null,
InputOption::VALUE_OPTIONAL,
"The format for the schema inputs",
'The format for the schema inputs.',
InputFormat::FILE->value,
);
$this->addOption(
self::FORMAT,
null,
InputOption::VALUE_OPTIONAL,
"The output format",
'The output format.',
OutputFormat::Text->value,
);
}

/**
* @throws SyntaxError
* @throws FilesystemException
*/
/** @throws SyntaxError|FilesystemException|JsonException */
protected function execute(InputInterface $input, OutputInterface $output): int
{
$style = new SymfonyStyle(
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/InputFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

enum InputFormat: string
{
case FILE = "file";
case TEXT = "text";
case FILE = 'file';
case TEXT = 'text';
}
2 changes: 1 addition & 1 deletion src/Inspections/Inspection.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function visitEnumValueDefinition(
): void {
}

public function __toString()
public function __toString(): string
{
return class_basename($this);
}
Expand Down

0 comments on commit 687f733

Please sign in to comment.