Skip to content
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
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
indent_size = 2

[*.{js,css}]
indent_size = 2
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
* text=auto eol=lf
2 changes: 1 addition & 1 deletion .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: actions/checkout@v3

- name: Install prettier and plugin-php
run: npm install --global [email protected] @prettier/[email protected]
run: npm i

- name: Lint with Prettier
continue-on-error: true
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ package-lock.json

# Environment
.env
.php-version
DOCKER_ENV
docker_tag

# IDE
.vscode/
.idea/
.idea/
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
vendor
**/*.min.js
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 120,
"endOfLine": "auto"
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"php -S localhost:8000 -t src"
],
"test": "./vendor/bin/phpunit --testdox tests",
"lint": "prettier --check *.md **/*.{php,md,js,css} !**/*.min.js --print-width 120",
"lint-fix": "prettier --write *.md **/*.{php,md,js,css} !**/*.min.js --print-width 120"
"lint": "npx prettier --check *.md **/*.{php,md,js,css}",
"lint-fix": "npx prettier --write *.md **/*.{php,md,js,css}"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"node": "18.x"
},
"devDependencies": {
"@prettier/plugin-php": "^0.18.8",
"prettier": "^2.6.2"
"@prettier/plugin-php": "^0.18.9",
"prettier": "^2.8.1"
}
}
13 changes: 6 additions & 7 deletions tests/RenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,13 @@ public function testFirstAndThirdColumnsSwappedWhenDirectionIsRtl(): void
{
$this->testParams["locale"] = "he";
$render = generateOutput($this->testStats, $this->testParams)["body"];
$renderCollapsedSpaces = preg_replace("/(\s)\s*/", '$1', $render);
$this->assertStringContainsString(
"<!-- Total Contributions big number -->\n<g transform='translate(412.5, 48)'>",
$renderCollapsedSpaces
$this->assertMatchesRegularExpression(
"/<!-- Total Contributions big number -->\\s*<g transform='translate\\(412\\.5, 48\\)'>/",
$render
);
$this->assertStringContainsString(
"<!-- Longest Streak big number -->\n<g transform='translate(82.5, 48)'>",
$renderCollapsedSpaces
$this->assertMatchesRegularExpression(
"/<!-- Longest Streak big number -->\\s*<g transform='translate\\(82\\.5, 48\\)'>/",
$render
);
}

Expand Down