Skip to content

Version 3 #9

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

Merged
merged 4 commits into from
Feb 23, 2025
Merged
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
3 changes: 3 additions & 0 deletions .devcontainer/050-xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
xdebug.mode = develop
xdebug.start_with_request = trigger
xdebug.client_port = 9000
40 changes: 29 additions & 11 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,43 @@
ARG IMAGE_REGISTRY_PHP
ARG IMAGE_TAG_PHP_VSCODE
FROM $IMAGE_REGISTRY_PHP:$IMAGE_TAG_PHP_VSCODE
ARG IMAGE_TAG_PHP
FROM $IMAGE_REGISTRY_PHP:$IMAGE_TAG_PHP

ARG USERNAME=code
ARG USER=code
ARG GROUP=code
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ARG WORKSPACE_PATH=/workspace
ARG TARGETARCH

RUN groupadd --gid "$USER_GID" "$USERNAME" \
&& useradd --uid "$USER_UID" --gid "$USER_GID" --create-home "$USERNAME" --shell /bin/bash \
# Latest version: https://github.com/boxboat/fixuid/releases
ENV FIXUID_VERSION=0.6.0

RUN curl -fsSLo /tmp/fixuid.tar.gz "https://github.com/boxboat/fixuid/releases/download/v$FIXUID_VERSION/fixuid-${FIXUID_VERSION}-linux-${TARGETARCH}.tar.gz" \
&& tar -xf /tmp/fixuid.tar.gz -C /usr/local/bin fixuid

RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends \
openssh-client \
sudo \
&& apt-get autoremove --assume-yes \
&& apt-get clean --assume-yes \
&& rm -rf /var/lib/apt/lists/*

RUN groupadd --gid "$USER_GID" "$USER" \
&& useradd --uid "$USER_UID" --gid "$USER_GID" --create-home "$USER" --shell /bin/bash \
&& mkdir -p \
/etc/fixuid \
"$WORKSPACE_PATH" \
"/home/$USERNAME/.vscode-server/extensions" \
"/home/$USER/.vscode-server/extensions" \
"/home/$USER/.composer" \
&& chown -R "$USER_UID":"$USER_GID" \
"$WORKSPACE_PATH" \
"/home/$USERNAME/.vscode-server" \
&& echo "$USERNAME" ALL=\(root\) NOPASSWD:ALL > "/etc/sudoers.d/$USERNAME" \
&& chmod 0440 "/etc/sudoers.d/$USERNAME"
"/home/$USER/.vscode-server" \
"/home/$USER/.composer" \
&& echo "$USER" ALL=\(root\) NOPASSWD:ALL > "/etc/sudoers.d/$USER" \
&& chmod 0440 "/etc/sudoers.d/$USER" \
&& printf "user: $USER\ngroup: $GROUP\npaths:\n - /var/www\n - /home/$USER\n\n" > /etc/fixuid/config.yml

WORKDIR $WORKSPACE_PATH

ENV PATH=$PATH:${WORKSPACE_PATH}/vendor/bin

CMD ["docker-cmd.sh"]
9 changes: 6 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[{*,*.dist}.{yml,yaml,neon}]
[*.{yml,yaml}]
indent_size = 2

[*neon,*.go]
indent_style = tab
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ REGISTRY_HOST=ghcr.io
REGISTRY_PATH=ilyes512

IMAGE_REGISTRY_PHP=${REGISTRY_HOST}/${REGISTRY_PATH}/php83
IMAGE_TAG_PHP_VSCODE=vscode-1.0.0
IMAGE_TAG_PHP=builder-1.2.0
10 changes: 9 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.devcontainer export-ignore
/.github export-ignore
/.vscode export-ignore
/docs export-ignore
/tests export-ignore
Expand All @@ -10,10 +12,16 @@
/.env export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.markdownlint-cli2.yaml export-ignore
/.vsls.json export-ignore
/auth.json export-ignore
/phpstan.neon export-igore
/ecs.php export-ignore
/phpstan.neon export-ignore
/phpstan.dist.neon export-ignore
/phpstan-baseline.neon export-ignore
/phpunit.xml export-ignore
/phpunit.xml.dist export-ignore
/Taskfile.dist.yml export-ignore
/Taskfile.yml export-ignore
/compose.yml export-ignore
/phpcs.xml export-ignore
32 changes: 32 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Config options: https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
labels:
- dependencies
- composer
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
labels:
- dependencies
- npm
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- dependencies
- github-actions
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
labels:
- dependencies
- docker
25 changes: 25 additions & 0 deletions .github/workflows/md.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Markdown

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
paths:
- '**.md'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
mdlint:
name: Checkstyle
runs-on: ubuntu-24.04

steps:
- name: Checkout repository
uses: actions/checkout@v4.2.2

- name: Lint Markdown files
uses: DavidAnson/markdownlint-cli2-action@v18.0.0
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
!.env
.DS_Store
/coverage
/dev
/composer.lock
/vendor
/phpstan.neon
/phpunit.xml
/.phpunit.cache
/.phpunit.result.cache
/.phplint.cache
/.phpstan.cache
/auth.json
Taskfile.yml

# Custom
docs.html
/temp
24 changes: 24 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# CLI config: https://github.com/DavidAnson/markdownlint-cli2?tab=readme-ov-file#markdownlint-cli2jsonc
# Lint rules: https://github.com/DavidAnson/markdownlint?tab=readme-ov-file#rules--aliases

config:
line-length:
line_length: 120
no-inline-html:
allowed_elements:
- dl
- dt
- dd
- details
- summary
- code
ul-style:
style: dash

globs:
- '**/*.md'
- '!node_modules'
- '!vendor'

gitignore: true
showFound: true
10 changes: 5 additions & 5 deletions Ilyes512CodingStandard/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,7 @@
<!-- CUSTOM TRAILING COMMA RULES END -->

<!-- CUSTOM NAMESPACES RULES START -->
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses">
<properties>
<property name="caseSensitive" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
<rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse"/>
<rule ref="SlevomatCodingStandard.Namespaces.NamespaceDeclaration"/>
<rule ref="SlevomatCodingStandard.Namespaces.NamespaceSpacing"/>
Expand Down Expand Up @@ -195,4 +191,8 @@
</properties>
</rule>
<!-- CUSTOM TYPE HINTS RULES START -->

<!-- CUSTOM COMMENTING RULES START-->
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing"/>
<!-- CUSTOM COMMENTING RULES END -->
</ruleset>
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ Add a `phpcs.xml` file to the root of your project. The below config example is

## Using the PHPCSStandards plugin

The above config assumes you allowed installing the [PHP_CodeSniffer](https://github.com/PHPCSStandards/composer-installer) plugin. Composer will prompt you to install it when you install this package. If you didn't, you can allow it by adding the following to your composer.json:
The above config assumes you allowed installing the
[PHP_CodeSniffer](https://github.com/PHPCSStandards/composer-installer) plugin. Composer will prompt you to install it
when you install this package. If you didn't, you can allow it by adding the following to your composer.json:

```json
{
Expand Down
Loading