Skip to content

Commit 12789c6

Browse files
authored
Merge pull request #66 from pdphilip/5.x-dev
Limits / Keyword ID / Formating
2 parents 8bf1d86 + 1b53e00 commit 12789c6

20 files changed

+3587
-595
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2

.envrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
use flake . --impure
1+
export NIXPKGS_ALLOW_UNFREE=1
2+
3+
if ! use flake . --impure --allow-dirty --accept-flake-config ; then
4+
echo "Snowblower shell could not be loaded." >&2
5+
fi

.github/workflows/lint.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: "Lint"
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
PHP_VERSION: "8.2"
9+
10+
jobs:
11+
phplint:
12+
name: phplint
13+
runs-on: ubuntu-latest
14+
15+
permissions:
16+
# Give the default GITHUB_TOKEN write permission to commit and push the
17+
# added or changed files to the repository.
18+
contents: write
19+
20+
steps:
21+
- name: "Checkout"
22+
uses: "actions/checkout@v4"
23+
24+
- name: "Install PHP"
25+
uses: "shivammathur/setup-php@v2"
26+
with:
27+
coverage: "none"
28+
extensions: json, dom, curl, libxml, mbstring
29+
php-version: ${{ env.PHP_VERSION }}
30+
31+
- name: "Install dependencies with Composer"
32+
uses: "ramsey/[email protected]"
33+
with:
34+
composer-options: "--no-suggest"
35+
36+
- name: "Format the code"
37+
continue-on-error: true
38+
run: ./vendor/bin/pint --config ./pint.json
39+
40+
- name: "Commit the changes"
41+
uses: stefanzweifel/git-auto-commit-action@v5
42+
with:
43+
commit_message: "apply pint formatting"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ vendor
88
!secrets/.env*
99
.sb*
1010
secrets.nix
11+
.aider*
1112

1213
# pre-commit
1314
.pre-commit-config.yaml
@@ -26,4 +27,4 @@ coverage
2627
phpunit.xml
2728
phpstan.neon
2829
testbench.yaml
29-
node_modules
30+
node_modules

.php-cs-fixer.php

Lines changed: 0 additions & 239 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,65 @@ If you do not run
1818
nix develop --impure
1919
```
2020

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

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

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

27-
During development, you will need to start a local elasticsearch instance. To start elasticsearch run:
27+
1. Make sure you have Docker and Docker Compose installed on your system.
28+
29+
2. Start the development environment:
30+
31+
```sh
32+
docker-compose up -d
33+
```
34+
35+
This will start:
36+
- Elasticsearch (accessible at http://localhost:9200)
37+
- Kibana (accessible at http://localhost:5601)
38+
- Redis (accessible at localhost:6379)
39+
40+
All services include health checks to ensure they're properly initialized before use.
41+
42+
3. To stop the environment:
43+
44+
```sh
45+
docker-compose down
46+
```
47+
48+
4. To view logs from the services:
49+
50+
```sh
51+
docker-compose logs -f
52+
```
53+
54+
### Development with Nix
55+
56+
During development with the Nix setup, you will need to start a local elasticsearch instance. To start elasticsearch run:
2857

2958
```sh
3059
just up
3160
```
3261

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

35-
![img.png](assets/contributing-just-up.png)
36-
3764
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 "$@"`.
65+
66+
### Development with Docker
67+
68+
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.
69+
70+
To run tests:
71+
72+
```sh
73+
./vendor/bin/pest
74+
```
75+
76+
To run a specific test:
77+
78+
```sh
79+
./vendor/bin/pest --filter="test_name"
80+
```
81+
82+
The Docker environment provides all necessary services configured with appropriate default settings for development and testing.

0 commit comments

Comments
 (0)