Skip to content

Limits / Keyword ID / Formating #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: 5.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
6 changes: 5 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
use flake . --impure
export NIXPKGS_ALLOW_UNFREE=1

if ! use flake . --impure --allow-dirty --accept-flake-config ; then
echo "Snowblower shell could not be loaded." >&2
fi
43 changes: 43 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Lint"

on:
push:
pull_request:

env:
PHP_VERSION: "8.2"

jobs:
phplint:
name: phplint
runs-on: ubuntu-latest

permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write

steps:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: json, dom, curl, libxml, mbstring
php-version: ${{ env.PHP_VERSION }}

- name: "Install dependencies with Composer"
uses: "ramsey/[email protected]"
with:
composer-options: "--no-suggest"

- name: "Format the code"
continue-on-error: true
run: ./vendor/bin/pint --config ./pint.json

- name: "Commit the changes"
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "apply pint formatting"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ vendor
!secrets/.env*
.sb*
secrets.nix
.aider*

# pre-commit
.pre-commit-config.yaml
Expand All @@ -26,4 +27,4 @@ coverage
phpunit.xml
phpstan.neon
testbench.yaml
node_modules
node_modules
239 changes: 0 additions & 239 deletions .php-cs-fixer.php

This file was deleted.

57 changes: 51 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,65 @@ If you do not run
nix develop --impure
```

this will pull down all dependencies, install hooks and formatters etc. If done correctly you should see a screen like this:
this will pull down all dependencies, install hooks and formatters etc.

![img.png](assets/contributeing-install-success.png)
### Docker Setup

### Development
For those who prefer Docker, we've included a `docker-compose.yml` file to quickly set up a development environment with all required services.

During development, you will need to start a local elasticsearch instance. To start elasticsearch run:
1. Make sure you have Docker and Docker Compose installed on your system.

2. Start the development environment:

```sh
docker-compose up -d
```

This will start:
- Elasticsearch (accessible at http://localhost:9200)
- Kibana (accessible at http://localhost:5601)
- Redis (accessible at localhost:6379)

All services include health checks to ensure they're properly initialized before use.

3. To stop the environment:

```sh
docker-compose down
```

4. To view logs from the services:

```sh
docker-compose logs -f
```

### Development with Nix

During development with the Nix setup, you will need to start a local elasticsearch instance. To start elasticsearch run:

```sh
just up
```

This will start process-compose and an elastic search instance.

![img.png](assets/contributing-just-up.png)

You can now open a new terminal window and run tests using pest. For conviance purposes the nix shell has the command `p` linked to run `./vendor/bin/pest` and `pf` linked to run `./vendor/bin/pest --filter "$@"`.

### Development with Docker

When using the Docker setup, all required services are already running after executing `docker-compose up -d`. You can run tests directly against these services.

To run tests:

```sh
./vendor/bin/pest
```

To run a specific test:

```sh
./vendor/bin/pest --filter="test_name"
```

The Docker environment provides all necessary services configured with appropriate default settings for development and testing.
Loading