Skip to content

Commit

Permalink
Merge pull request #3642 from MTES-MCT/feature/3641-blacklist-ci
Browse files Browse the repository at this point in the history
[CI] Blacklist les fonctions de debug
  • Loading branch information
emilschn authored Jan 30, 2025
2 parents 1c6eef1 + 4825f1c commit 5405036
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 18 deletions.
8 changes: 4 additions & 4 deletions assets/scripts/vanilla/services/form_helper.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import * as Sentry from "@sentry/browser";

Node.prototype.addEventListeners = function (eventNames, eventFunction) {
for (const eventName of eventNames.split(' ')) { this.addEventListener(eventName, eventFunction) }
}
Expand Down Expand Up @@ -97,8 +99,6 @@ forms.forEach((form) => {
const finishSubmitBtn = document.querySelector('#form_finish_submit')
request.open('POST', event.target.getAttribute('data-handle-url'))
request.upload.addEventListener('progress', function (e) {
console.log('progress')
console.log(e)
totalProgress.classList.remove('fr-hidden')
finishSubmitBtn.disabled = true
finishSubmitBtn.innerHTML = 'Téléversement en cours, veuillez patienter....'
Expand All @@ -112,8 +112,6 @@ forms.forEach((form) => {
progress.value = percentCompleted
})
request.addEventListener('load', function (e) {
console.log('load')
console.log(e)
event.target.parentElement.classList.remove('fr-icon-refresh-line');
[preview, deleter].forEach(el => el?.classList?.remove('fr-hidden'))
progress.value = 0
Expand All @@ -124,6 +122,8 @@ forms.forEach((form) => {
resTextEl.innerText = jsonRes.error
resTextEl.classList.remove('fr-hidden')
resTextEl.classList.add('fr-text-label--red-marianne')
console.error(jsonRes.error)
Sentry.captureException(new Error(error))
} else {
resTextEl.innerText = jsonRes.titre
resTextEl.classList.remove('fr-hidden')
Expand Down
1 change: 0 additions & 1 deletion assets/scripts/vanilla/services/search_filter_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const removeBadge = (badge) => {
select.querySelector(`option[value="${val}"]`)?.classList?.remove('fr-hidden')
input?.remove()
const badges = badge.parentElement.querySelectorAll('.fr-badge[data-value]').length !== 1
console.log(badge.parentElement.querySelectorAll('.fr-badge[data-value]').length)
if (!badges) {
badge?.parentElement?.querySelector('.fr-badge:not([data-value])')?.classList?.remove('fr-hidden')
if (select.tagName === 'SELECT') { select.options[0].selected = true }
Expand Down
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@
"require-dev": {
"dama/doctrine-test-bundle": "8.2.*",
"doctrine/doctrine-fixtures-bundle": "^3.4",
"ekino/phpstan-banned-code": "^2.1",
"fakerphp/faker": "^1.20",
"nelmio/api-doc-bundle": "^4.32",
"phpro/grumphp-shim": "^1.13",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "1.10.44",
"phpunit/phpunit": "^9.5",
"symfony/browser-kit": "7.1.*",
Expand All @@ -90,10 +92,11 @@
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true,
"symfony/flex": true,
"symfony/runtime": true,
"php-http/discovery": true,
"phpro/grumphp-shim": true,
"php-http/discovery": true
"phpstan/extension-installer": true,
"symfony/flex": true,
"symfony/runtime": true
},
"optimize-autoloader": true,
"classmap-authoritative": true,
Expand Down
114 changes: 114 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default [
"no-unused-expressions": "off",
"vue/no-mutating-props": "off",
"vue/no-reserved-component-names": "off",
"no-console": ["error", { "allow": ["warn", "error"] }]
},
},
]
]
8 changes: 0 additions & 8 deletions grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ grumphp:
enforce_capitalized_subject: false
matchers:
must contain github issue number: '/#(\d+)$/'
git_blacklist:
keywords:
- 'var_dump('
- 'dump('
- ' dd('
- ';dd('
- 'die('
- 'exit('
yamllint:
parse_custom_tags: true
phpstan: ~
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5405036

Please sign in to comment.