Skip to content
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
30 changes: 30 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "Debian",
"image": "mcr.microsoft.com/devcontainers/base:bullseye",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"remoteEnv": {
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}"
},
"customizations": {
"vscode": {
"extensions": [
"eamodio.gitlens",
"github.copilot",
"github.copilot-chat",
"github.vscode-github-actions",
"ms-vscode.makefile-tools",
"bmewburn.vscode-intelephense-client",
"calebporzio.better-phpunit"
],
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh"
},
"mcp": {
"servers": {}
}
}
}
}
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ updates:
dev-dependencies:
dependency-type: development

- package-ecosystem: "docker"
open-pull-requests-limit: 20
directory: "/"
schedule:
interval: "weekly"
day: friday
time: "04:00"
groups:
docker-dependencies:
patterns:
- "*"

- package-ecosystem: github-actions
directory: "/"
schedule:
Expand All @@ -23,3 +35,11 @@ updates:
github-actions-dependencies:
patterns:
- "*"

- package-ecosystem: "devcontainers"
open-pull-requests-limit: 20
directory: "/"
schedule:
interval: weekly
day: friday
time: "04:00"
6 changes: 2 additions & 4 deletions .github/workflows/__shared-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@ permissions: {}

jobs:
checks:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

strategy:
matrix:
include:
- php-versions: "8.1"
- php-versions: "8.2"
- php-versions: "8.3"
- php-versions: "8.4"
- php-versions: "8.5"
stable: true

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions: {}

jobs:
greetings:
uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@666b7b6eb000db3e8614647871fa60c9f1eb7179 # 0.31.4
uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@b17226e57c8ef31f860719766656ebb6df017218 # 0.31.6
permissions:
contents: read
issues: write
Expand Down
90 changes: 24 additions & 66 deletions .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,73 +20,32 @@ jobs:
id-token: write
secrets: inherit

docs-generate-site:
runs-on: ubuntu-latest
needs: ci
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false

- run: |
mkdir -p ./_site

echo -e "theme: jekyll-theme-cayman" > ./_site/_config.yml

to_title_case() {
echo "$1" | awk '{
for (i=1; i<=NF; i++) {
$i = toupper(substr($i, 1, 1)) tolower(substr($i, 2))
}
print
}'
}

create_site_page() {
page="$1"
title="$(to_title_case "$2")"
content_path="$3"
echo -e "---\nlayout: default\ntitle: $title\n---\n" > "$page"
echo "$(sed -r s"/(\{%[^%]+%\})/{% raw %}\1{% endraw %}/g" "$content_path")" >> "$page"
}

create_site_page "./_site/index.md" "Home" "./README.md"

for filepath in ./docs/*.md; do
filename=$(basename -- "$filepath")
section="${filename%.*}"
mkdir -p "./_site/$section"
create_site_page "./_site/$section/index.md" "$section" "$filepath"
done

- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: docs-site
path: ./_site

docs-generate-phpdoc:
runs-on: ubuntu-latest
needs: ci
permissions:
contents: read
container: phpdoc/phpdoc:3
env:
ARTIFACT_PATH: ./_site
outputs:
artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }}
artifact-path: ${{ env.ARTIFACT_PATH }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false

- name: 📃 Generate PHP documentation
run: docker run --rm -v $(pwd):/data phpdoc/phpdoc:3 -d ./src -t ./_site/phpdoc
run: phpdoc run -d ./src -t $ARTIFACT_PATH/phpdoc

- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
id: upload-artifact
with:
name: docs-phpdoc
path: ./_site
path: ${{ env.ARTIFACT_PATH }}

docs-publish:
name: Publish documentation
needs: [docs-generate-site, docs-generate-phpdoc]
needs: docs-generate-phpdoc
runs-on: ubuntu-latest
permissions:
pages: write
Expand All @@ -95,24 +54,23 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
pattern: "docs-*"
path: ./
merge-multiple: true

- name: ⚙️ Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
persist-credentials: false

- name: Build with Jekyll
uses: actions/jekyll-build-pages@44a6e6beabd48582f863aeeb6cb2151cc1716697 # v1.0.13
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
source: ./
destination: ./_site
artifact-ids: ${{ needs.docs-generate-phpdoc.outputs.artifact-id }}
path: ${{ needs.docs-generate-phpdoc.outputs.artifact-path }}

- name: Upload artifact
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
- uses: hoverkraft-tech/ci-github-publish/actions/deploy/jekyll@84e8ace407055e7a40ba6670a8c697e1ce2dfafa # 0.20.1
id: build
with:
site-path: ${{ needs.docs-generate-phpdoc.outputs.artifact-path }}
pages: |
./docs/*.md

- name: 🚀 Deploy to GitHub Pages
- uses: hoverkraft-tech/ci-github-publish/actions/deploy/github-pages@84e8ace407055e7a40ba6670a8c697e1ce2dfafa # 0.20.1
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
with:
build-path: ${{ steps.build.outputs.build-path }}
2 changes: 1 addition & 1 deletion .github/workflows/need-fix-to-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions: {}

jobs:
main:
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@666b7b6eb000db3e8614647871fa60c9f1eb7179 # 0.31.4
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@0.31.6
permissions:
contents: read
issues: write
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: "Prepare release"

on:
push:
branches: [main]
pull_request:
types: [opened, reopened, synchronize]

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

permissions: {}

jobs:
release:
uses: hoverkraft-tech/ci-github-publish/.github/workflows/prepare-release.yml@84e8ace407055e7a40ba6670a8c697e1ce2dfafa # 0.20.1
permissions:
contents: write
id-token: write
pull-requests: write
3 changes: 1 addition & 2 deletions .github/workflows/semantic-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: "Pull Request - Semantic Lint"

on:
Expand All @@ -12,7 +11,7 @@ permissions: {}

jobs:
main:
uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@666b7b6eb000db3e8614647871fa60c9f1eb7179 # 0.31.4
uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@b17226e57c8ef31f860719766656ebb6df017218 # 0.31.6
permissions:
contents: write
pull-requests: write
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions: {}

jobs:
main:
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@666b7b6eb000db3e8614647871fa60c9f1eb7179 # 0.31.4
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@0.31.6
permissions:
issues: write
pull-requests: write
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PHP_VERSION=8.4
PHP_VERSION=8.5
PROJECT_NAME=$(shell basename $(CURDIR))
UID=$(shell id -u)
GID=$(shell id -g)
Expand Down Expand Up @@ -58,8 +58,7 @@ phpstan: ## Execute PHPStan for given PHP version
@$(call run-php,composer phpstan -- $(filter-out $@,$(MAKECMDGOALS)))

ci: ## Execute CI scripts for given PHP version
$(MAKE) build-php
$(MAKE) install
$(MAKE) setup
@$(call run-php,composer ci -- $(filter-out $@,$(MAKECMDGOALS)))

generate-css-referentials: ## Generate referentials for given PHP version
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
📢 **Php CSS Lint** is a php script that lint css files and strings.
It supports [W3C](https://www.w3.org/Style/CSS/) and [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS) CSS specifications.

```
```txt
===========================================================

____ _ ____ ____ ____ _ _ _
Expand Down Expand Up @@ -40,8 +40,8 @@ It supports [W3C](https://www.w3.org/Style/CSS/) and [MDN](https://developer.moz

# Documentation

1. [Installation](https://neilime.github.io/php-css-lint/installation)
2. [Usage](https://neilime.github.io/php-css-lint/usage)
3. [Code Coverage](https://codecov.io/gh/neilime/php-css-lint)
4. [PHP Doc](https://neilime.github.io/php-css-lint/phpdoc)
5. [Development](https://neilime.github.io/php-css-lint/development)
1. [Installation](./docs/installation.md)
2. [Usage](./docs/usage.md)
3. [Development](./docs/development.md)
4. [Code Coverage](https://codecov.io/gh/neilime/php-css-lint)
5. [PHP Doc](https://neilime.github.io/php-css-lint/phpdoc)
2 changes: 1 addition & 1 deletion src/CssLint/LintConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function propertyExists(string $property): bool
$property
);

if ($propertyWithoutConstructor !== $property) {
if ($propertyWithoutConstructor && $propertyWithoutConstructor !== $property) {
if (!empty($this->propertiesStandards[$propertyWithoutConstructor])) {
return true;
}
Expand Down
Loading