diff --git a/.editorconfig b/.editorconfig index cd8eb86..642733a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,15 +1,19 @@ -; This file is for unifying the coding style for different editors and IDEs. -; More information at http://editorconfig.org - +# EditorConfig is awesome: http://EditorConfig.org root = true [*] charset = utf-8 +end_of_line = lf indent_size = 4 indent_style = space -end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true +[{Makefile,*.mak}] +indent_style = tab + [*.md] trim_trailing_whitespace = false + +[{Makefile,*.mak,*.sh,*.yml}] +indent_size = 2 diff --git a/.envrc.example b/.envrc.example new file mode 100644 index 0000000..9ab3d3a --- /dev/null +++ b/.envrc.example @@ -0,0 +1 @@ +layout php diff --git a/.gitattributes b/.gitattributes index b263871..1485822 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,10 +1,2 @@ -# Path-based git attributes -# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html - -# Ignore all test and documentation with "export-ignore". -/.gitattributes export-ignore -/.gitignore export-ignore -/.travis.yml export-ignore -/phpunit.xml.dist export-ignore -/.scrutinizer.yml export-ignore -/tests export-ignore +* text=auto eol=lf whitespace=tab-in-indent,blank-at-eol,tabwidth=4 +makefile text whitespace=-tab-in-indent,blank-at-eol,tabwidth=4 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..75c1ae4 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,48 @@ +name: Build + +on: + pull_request: + +jobs: + test: + strategy: + matrix: + illuminate-version: + - 9 + - 10 + php-version: + - 8.0 + - 8.1 + - 8.2 + exclude: + - illuminate-version: 10 + php-version: 8.0 + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: composer:v2 + + - name: Install dependencies + run: | + composer require \ + --no-ansi \ + --no-interaction \ + --no-progress \ + --no-scripts \ + --prefer-dist \ + illuminate/support:^${{ matrix.illuminate-version }} + + - name: Lint Code + run: vendor/bin/tlint + + - name: Run tests + run: vendor/bin/phpunit diff --git a/.gitignore b/.gitignore index bd7fbbe..4a3c8a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ +/.envrc +/.idea/ +/.phpunit.result.cache +/composer.lock /vendor -build -composer.lock -composer.phar -.idea/ -.phpunit.result.cache diff --git a/composer.json b/composer.json index b890b68..4563c8c 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,8 @@ "ext-pcntl": "*", "ext-sockets": "*", "mockery/mockery": "^1", - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^9.5", + "tightenco/tlint": "^8 || ^9" }, "extra": { "include_files": [ diff --git a/tlint.json b/tlint.json new file mode 100644 index 0000000..fa96d60 --- /dev/null +++ b/tlint.json @@ -0,0 +1,10 @@ +{ + "preset": "laravel", + "disabled": [ + "SpaceAfterSoleNotOperator", + "NoParensEmptyInstantiations", + "OneLineBetweenClassVisibilityChanges", + "ModelMethodOrder", + "ConcatenationNoSpacing" + ] +}