Skip to content
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

Use 2 spaces to indent xliff files #1615

Merged
merged 1 commit into from
Aug 9, 2021
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
5 changes: 4 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,8 @@ jobs:
- name: Install required dependencies
run: sudo apt-get update && sudo apt-get install libxml2-utils

- name: Lint files
- name: Lint xml files
run: make lint-xml

- name: Lint xliff files
run: make lint-xliff
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ all:
@echo "Please choose a task."
.PHONY: all

lint: lint-composer lint-yaml lint-xml lint-php
lint: lint-composer lint-yaml lint-xml lint-xliff lint-php
.PHONY: lint

lint-composer:
Expand All @@ -19,7 +19,7 @@ lint-yaml:
.PHONY: lint-yaml

lint-xml:
find . \( -name '*.xml' -or -name '*.xliff' \) \
find . -name '*.xml' \
-not -path './vendor/*' \
-not -path './src/Resources/public/vendor/*' \
| while read xmlFile; \
Expand All @@ -30,6 +30,18 @@ lint-xml:

.PHONY: lint-xml

lint-xliff:
find . -name '*.xliff' \
-not -path './vendor/*' \
-not -path './src/Resources/public/vendor/*' \
| while read xmlFile; \
do \
XMLLINT_INDENT=' ' xmllint --encode UTF-8 --format "$$xmlFile"|diff - "$$xmlFile"; \
if [ $$? -ne 0 ] ;then exit 1; fi; \
done

.PHONY: lint-xliff

lint-php:
php-cs-fixer fix --ansi --verbose --diff --dry-run
.PHONY: lint-php
Expand Down
4 changes: 2 additions & 2 deletions templates/project/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[*.{yaml,yml,twig,php}]
[*.{xml,yaml,yml,twig,php}]
indent_size = 4

[.yamllint]
indent_size = 4

[*.{js,json,scss,css}]
[*.{xliff,js,json,scss,css}]
indent_size = 2

[composer.json]
Expand Down
5 changes: 4 additions & 1 deletion templates/project/.github/workflows/lint.yaml.twig
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,8 @@ jobs:
- name: Install required dependencies
run: sudo apt-get update && sudo apt-get install libxml2-utils

- name: Lint files
- name: Lint xml files
run: make lint-xml

- name: Lint xliff files
run: make lint-xliff
16 changes: 14 additions & 2 deletions templates/project/Makefile.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ all:
@echo "Please choose a task."
.PHONY: all

lint: lint-composer lint-yaml lint-xml lint-php
lint: lint-composer lint-yaml lint-xml lint-xliff lint-php
.PHONY: lint

lint-composer:
Expand All @@ -19,7 +19,7 @@ lint-yaml:
.PHONY: lint-yaml

lint-xml:
find . \( -name '*.xml' -or -name '*.xliff' \) \
find . -name '*.xml' \
-not -path './vendor/*' \
-not -path './src/Resources/public/vendor/*' \
| while read xmlFile; \
Expand All @@ -30,6 +30,18 @@ lint-xml:

.PHONY: lint-xml

lint-xliff:
OskarStark marked this conversation as resolved.
Show resolved Hide resolved
find . -name '*.xliff' \
-not -path './vendor/*' \
-not -path './src/Resources/public/vendor/*' \
| while read xmlFile; \
do \
XMLLINT_INDENT=' ' xmllint --encode UTF-8 --format "$$xmlFile"|diff - "$$xmlFile"; \
if [ $$? -ne 0 ] ;then exit 1; fi; \
done

.PHONY: lint-xliff

lint-php:
php-cs-fixer fix --ansi --verbose --diff --dry-run
.PHONY: lint-php
Expand Down