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

Soporte para Carta Porte 3.1 (version 1.3.3) #25

Merged
merged 8 commits into from
Jun 21, 2024
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 .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/sonar-project.properties export-ignore

# Do not count these files on github code language
/tests/_files/** linguist-detectable=false
30 changes: 24 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: build
on:
workflow_dispatch:
pull_request:
branches: [ "main" ]
push:
Expand All @@ -12,12 +13,29 @@ on:

jobs:

composer-normalize:
name: Composer normalization
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none
tools: composer-normalize
env:
fail-fast: true
- name: Composer normalize
run: composer-normalize

phpcs:
name: Code style (phpcs)
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -34,7 +52,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -51,7 +69,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -64,7 +82,7 @@ jobs:
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -82,7 +100,7 @@ jobs:
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -95,7 +113,7 @@ jobs:
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: coverage
on:
workflow_dispatch:
push:
branches: [ "main" ]

Expand All @@ -14,7 +15,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -27,7 +28,7 @@ jobs:
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -37,7 +38,7 @@ jobs:
- name: Create code coverage
run: vendor/bin/phpunit --testdox --verbose --coverage-xml=build/coverage --coverage-clover=build/coverage/clover.xml --log-junit=build/coverage/junit.xml
- name: Store code coverage
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: build/coverage
Expand Down Expand Up @@ -72,7 +73,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Unshallow clone to provide blame information
run: git fetch --unshallow
- name: Setup PHP
Expand All @@ -85,15 +86,15 @@ jobs:
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install project dependencies
run: composer upgrade --no-interaction --no-progress --prefer-dist
- name: Obtain code coverage
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: code-coverage
path: build/coverage
Expand Down
9 changes: 5 additions & 4 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpcs" version="^3.8.1" installed="3.8.1" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.8.1" installed="3.8.1" location="./tools/phpcbf" copy="false"/>
<phar name="php-cs-fixer" version="^3.47.0" installed="3.47.0" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpstan" version="^1.10.56" installed="1.10.56" location="./tools/phpstan" copy="false"/>
<phar name="phpcs" version="^3.10.1" installed="3.10.1" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.10.1" installed="3.10.1" location="./tools/phpcbf" copy="false"/>
<phar name="php-cs-fixer" version="^3.59.3" installed="3.59.3" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpstan" version="^1.11.5" installed="1.11.5" location="./tools/phpstan" copy="false"/>
<phar name="composer-normalize" version="^2.43.0" installed="2.43.0" location="./tools/composer-normalize" copy="false"/>
</phive>
33 changes: 21 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
{
"name": "phpcfdi/cfdi-cleaner",
"description": "Clean up Mexican CFDI",
"keywords": ["cfdi", "sat", "mexico"],
"homepage": "https://github.com/phpcfdi/cfdi-cleaner",
"license": "MIT",
"keywords": [
"cfdi",
"sat",
"mexico"
],
"authors": [
{
"name": "Carlos C Soto",
"email": "eclipxe13@gmail.com"
}
],
"homepage": "https://github.com/phpcfdi/cfdi-cleaner",
"require": {
"php": ">=7.3",
"ext-dom": "*",
"ext-libxml": "*",
"symfony/polyfill-php80": "^1.22"
},
"require-dev": {
"phpunit/phpunit": "^9.3",
"ext-json": "*"
"ext-json": "*",
"phpunit/phpunit": "^9.3"
},
"autoload": {
"psr-4": {
Expand All @@ -31,29 +35,34 @@
}
},
"scripts": {
"dev:build": ["@dev:fix-style", "@dev:test"],
"dev:build": [
"@dev:fix-style",
"@dev:test"
],
"dev:check-style": [
"@php tools/composer-normalize normalize --dry-run",
"@php tools/php-cs-fixer fix --dry-run --verbose",
"@php tools/phpcs --colors -sp"
],
"dev:coverage": [
"@php -dzend_extension=xdebug.so -dxdebug.mode=coverage vendor/bin/phpunit --coverage-html build/coverage/html/"
],
"dev:fix-style": [
"@php tools/composer-normalize normalize",
"@php tools/php-cs-fixer fix --verbose",
"@php tools/phpcbf --colors -sp"
],
"dev:test": [
"@dev:check-style",
"@php vendor/bin/phpunit --testdox --verbose --stop-on-failure",
"@php tools/phpstan analyse --verbose"
],
"dev:coverage": [
"@php -dzend_extension=xdebug.so -dxdebug.mode=coverage vendor/bin/phpunit --coverage-html build/coverage/html/"
]
},
"scripts-descriptions": {
"dev:build": "DEV: run dev:fix-style and dev:tests, run before pull request",
"dev:check-style": "DEV: search for code style errors using php-cs-fixer and phpcs",
"dev:fix-style": "DEV: fix code style errors using php-cs-fixer and phpcbf",
"dev:test": "DEV: run dev:check-style, phpunit and phpstan",
"dev:coverage": "DEV: run phpunit with xdebug and storage coverage in build/coverage/html/"
"dev:check-style": "DEV: search for code style errors using composer-normalize, php-cs-fixer and phpcs",
"dev:coverage": "DEV: run phpunit with xdebug and storage coverage in build/coverage/html/",
"dev:fix-style": "DEV: fix code style errors using composer-normalize, php-cs-fixer and phpcbf",
"dev:test": "DEV: run dev:check-style, phpunit and phpstan"
}
}
16 changes: 16 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ Utilizamos [Versionado Semántico 2.0.0](SEMVER.md).

Los cambios no liberados se integran a la rama principal, pero no requieren de la liberación de una nueva versión.

## Versión 1.3.3

- Se agrega *Complemento de Carta Porte 3.1* a la lista de espacio de nombres conocidos.

Se hacen los siguientes cambios al entorno de desarrollo:

- Se agrega a las herramientas de desarrollo `composer-normalize`:
- Se agrega a los scripts de desarrollo de `composer` en `dev:check-style` y `dev:fix-style`.
- Se agrega al flujo de trabajo de integración contínua.
- Se normaliza el archivo `composer.json`.
- Se aplicó en los flujos de trabajo:
- Se actualizan las acciones de GitHub a la versión 4.
- Se permite la ejecución de los flujos de trabajo manualmente.
- Se excluye `test/_files` de la detección de lenguajes de GitHub.
- Se actualizan las herramientas de desarrollo.

## Versión 1.3.2

- Se agrega *Comercio Exterior 2.0* a la lista de espacio de nombres conocidos.
Expand Down
2 changes: 2 additions & 0 deletions src/XmlDocumentCleaners/SetKnownSchemaLocations.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ class SetKnownSchemaLocations implements XmlDocumentCleanerInterface
=> 'http://www.sat.gob.mx/sitio_internet/cfd/CartaPorte/CartaPorte20.xsd',
'http://www.sat.gob.mx/CartaPorte30#3.0'
=> 'http://www.sat.gob.mx/sitio_internet/cfd/CartaPorte/CartaPorte30.xsd',
'http://www.sat.gob.mx/CartaPorte31#3.1'
=> 'http://www.sat.gob.mx/sitio_internet/cfd/CartaPorte/CartaPorte31.xsd',
'http://www.sat.gob.mx/esquemas/retencionpago/1/arrendamientoenfideicomiso#1.0'
=> 'http://www.sat.gob.mx/esquemas/retencionpago/1/arrendamientoenfideicomiso/arrendamientoenfideicomiso.xsd',
'http://www.sat.gob.mx/esquemas/retencionpago/1/dividendos#1.0'
Expand Down