Skip to content

Commit 6959035

Browse files
committed
Init basic template
1 parent b8b4aeb commit 6959035

File tree

5 files changed

+141
-3
lines changed

5 files changed

+141
-3
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
# Ignore all test and documentation with "export-ignore".
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/.github export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/tests export-ignore

.github/workflows/quality.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Quality Assurance
2+
3+
on:
4+
push: # (or pull requests)
5+
paths:
6+
- '.github/workflows/**'
7+
- '**.php'
8+
- 'psalm.xml.dist'
9+
- 'composer.json'
10+
11+
jobs:
12+
composer-validate:
13+
name: composer-validate
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup PHP 🔧
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: 8.3
22+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
23+
coverage: none
24+
tools: composer:v2
25+
26+
- name: Validate composer.json and composer.lock 👀
27+
run: composer validate
28+
29+
psalm:
30+
name: psalm
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Setup PHP 🔧
36+
uses: shivammathur/setup-php@v2
37+
with:
38+
php-version: 8.3
39+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
40+
coverage: none
41+
tools: composer:v2
42+
43+
- name: Install Dependencies 🔧
44+
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
45+
46+
# Installing psalm separately due to conflict with phpunit
47+
- name: Install psalm
48+
run: |
49+
wget https://github.com/vimeo/psalm/releases/latest/download/psalm.phar
50+
chmod +x psalm.phar
51+
mv psalm.phar /usr/local/bin/psalm
52+
53+
- name: Run psalm
54+
run: psalm --output-format=github
55+
56+
phploc:
57+
name: phploc
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- name: Setup PHP 🔧
63+
uses: shivammathur/setup-php@v2
64+
with:
65+
php-version: 8.3
66+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
67+
coverage: none
68+
tools: composer:v2
69+
70+
- name: Download phploc 🔧
71+
run: wget https://phar.phpunit.de/phploc.phar
72+
73+
- name: Run phploc
74+
run: php phploc.phar src/

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.idea
2+
.phpstorm.meta.php
3+
.phpunit.result.cache
4+
.phpunit.cache
5+
clover.xml
6+
coverage.xml
7+
_ide_helper.php
8+
composer.lock
9+
build
10+
vendor
11+
.DS_Store
12+
.lock
13+
node_modules
14+
package-lock.json
15+
yarn.lock
16+
logs
17+
.vscode
18+
.php_cs.cache
19+
.php-cs-fixer.cache

composer.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
11
{
22
"name": "laravelsu/highlight",
33
"description": "Laravel.su package code-highlighter",
4+
"keywords": [
5+
"highlight",
6+
"syntax-highlighting",
7+
"code-highlighter",
8+
"code-formatting",
9+
"highlighting",
10+
"text-editor",
11+
"code-syntax",
12+
"markdown"
13+
],
14+
"type": "library",
415
"license": "MIT",
516
"authors": [
617
{
718
"name": "Dmitriy Butko",
8-
"email": "[email protected]"
19+
"email": "[email protected]",
20+
"role": "Developer"
921
}
1022
],
1123
"require": {
1224
"php": "^8.3",
13-
"tempest/highlight": "^2.11"
25+
"tempest/highlight": "^2.11",
26+
"league/commonmark": "^2.6",
27+
"laravel/pint": "^1.18"
1428
},
1529
"autoload": {
1630
"psr-4": {
1731
"Laravelsu\\Highlight\\": "src/"
1832
}
1933
}
20-
}
34+
}

psalm.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
phpVersion="8.3"
4+
errorLevel="3"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
useDocblockTypes="false"
9+
useDocblockPropertyTypes="false"
10+
findUnusedBaselineEntry="true"
11+
findUnusedCode="false"
12+
>
13+
<projectFiles>
14+
<directory name="src"/>
15+
<ignoreFiles>
16+
<directory name="vendor"/>
17+
</ignoreFiles>
18+
</projectFiles>
19+
<issueHandlers>
20+
<MissingTemplateParam errorLevel="suppress" />
21+
</issueHandlers>
22+
</psalm>

0 commit comments

Comments
 (0)