Skip to content

Conversation

Gabriel29306
Copy link
Owner

🚀 Nouvelle Pull Request

Proposez vos modifications pour améliorer Papillon

Informations importantes

Merci de vous référer à la documentation sur la contribution si vous avez des questions à propos des pull requests (https://gitbook.getpapillon.xyz/organisation/outils-internes/github)

Checklist d'avant pull request

Veuillez cocher toutes les cases applicables en remplaçant [ ] par [x].

  • Vous avez testé de build le projet avec vos modifications et ce build a réussi
  • Vous respectez les conventions de codage et de nommage du projet
  • Vous utilisez la tabulation pour l'indentation afin de maintenir un code lisible
  • Cette pull request n'est pas un duplicata d'une autre
  • Cette pull request est prête à être revue (review) et fusionnée (merge)
  • Il n'y a pas de TODO (aka des annotations pour du code manquant) dans vos modifications
  • Il n'y a pas d'erreurs de langue dans votre code (grammaire, vocabulaire, conjugaison, orthographe)
  • Les détails des changements ont été décrits ci-dessous
  • Cette pull-request n'est pas une "breaking-change" (des modifications qui vont entraîner la modification du fonctionnement de certaines fonctionnalités déjà existantes)

Changelogs proposés

Décrivez les modifications que vous avez effectuées.

Informations supplémentaires

Ajoutez ici toute information supplémentaire si nécessaire.

Comment on lines +11 to +42
name: 🛠️ TypeScript and ESLint on Main
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: 📥 Checkout code
uses: actions/checkout@v3

- name: ⚙️ Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: 💾 Install dependencies
run: npm ci

- name: 🛠️ Commit and Push Fixes ESLint (Main)
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
npx eslint . --fix
if git diff --quiet; then
echo "No changes to commit."
else
git add .
git commit -m "🔧 Auto-fix ESLint issues"
git push
fi
- name: 🔍 Run TypeScript and ESLint checks
run: npm run lint

lint-development:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +43 to +59
name: 🛠️ TypeScript and ESLint on Pull Request
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
if: github.ref != 'refs/heads/main'
steps:
- name: Checkout code
- name: 📥 Checkout code
uses: actions/checkout@v3

- name: Pnpm setup
uses: pnpm/action-setup@v2
- name: ⚙️ Set up Node.js
uses: actions/setup-node@v3
with:
version: latest
node-version: 20

- name: Environnement setup
run: pnpm install
- name: 💾 Install dependencies
run: npm ci

- name: Typescript and Eslint scanning
run: pnpm lint
- name: 🔍 Run TypeScript and ESLint checks
run: npm run lint

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
preserveNewlines: true,
whitespaceCharacters: " ",
});
const formatted = converted.replace("\n", " ").replace(/Bonjour,|Bonjour à tous|Bonjour !|Bonsoir|Bonjour|Bonjour à tous, |Bonjour , |Bonsoir, /g, "").replace(/\n/g, "");

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This replaces only the first occurrence of "\n".

Copilot Autofix

AI 6 months ago

To fix the problem, we need to ensure that all newline characters in the converted string are replaced with spaces. This can be achieved by using a regular expression with the global flag (g) in the replace method. Specifically, we should replace "\n" with /\n/g in the replace call on line 8.

Suggested changeset 1
src/utils/format/format_pronote_news.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/utils/format/format_pronote_news.ts b/src/utils/format/format_pronote_news.ts
--- a/src/utils/format/format_pronote_news.ts
+++ b/src/utils/format/format_pronote_news.ts
@@ -7,3 +7,3 @@
   });
-  const formatted = converted.replace("\n", " ").replace(/Bonjour,|Bonjour à tous|Bonjour !|Bonsoir|Bonjour|Bonjour à tous, |Bonjour , |Bonsoir, /g, "").replace(/\n/g, "");
+  const formatted = converted.replace(/\n/g, " ").replace(/Bonjour,|Bonjour à tous|Bonjour !|Bonsoir|Bonjour|Bonjour à tous, |Bonjour , |Bonsoir, /g, "").replace(/\n/g, "");
   const trimmed = formatted.trim();
EOF
@@ -7,3 +7,3 @@
});
const formatted = converted.replace("\n", " ").replace(/Bonjour,|Bonjour à tous|Bonjour !|Bonsoir|Bonjour|Bonjour à tous, |Bonjour , |Bonsoir, /g, "").replace(/\n/g, "");
const formatted = converted.replace(/\n/g, " ").replace(/Bonjour,|Bonjour à tous|Bonjour !|Bonsoir|Bonjour|Bonjour à tous, |Bonjour , |Bonsoir, /g, "").replace(/\n/g, "");
const trimmed = formatted.trim();
Copilot is powered by AI and may make mistakes. Always verify output.
godetremy and others added 29 commits April 2, 2025 16:47
Co-authored-by: 𝕂𝕪𝕝𝕚𝕒𝕟 <164187100+Kgeek33@users.noreply.github.com>
Co-authored-by: 𝕂𝕪𝕝𝕚𝕒𝕟 <164187100+Kgeek33@users.noreply.github.com>
Co-authored-by: 𝕂𝕪𝕝𝕚𝕒𝕟 <164187100+Kgeek33@users.noreply.github.com>
Co-authored-by: 𝕂𝕪𝕝𝕚𝕒𝕟 <164187100+Kgeek33@users.noreply.github.com>
Co-authored-by: 𝕂𝕪𝕝𝕚𝕒𝕟 <164187100+Kgeek33@users.noreply.github.com>
Co-authored-by: 𝕂𝕪𝕝𝕚𝕒𝕟 <164187100+Kgeek33@users.noreply.github.com>
Co-authored-by: 𝕂𝕪𝕝𝕚𝕒𝕟 <164187100+Kgeek33@users.noreply.github.com>
Co-authored-by: 𝕂𝕪𝕝𝕚𝕒𝕟 <164187100+Kgeek33@users.noreply.github.com>
Co-authored-by: 𝕂𝕪𝕝𝕚𝕒𝕟 <164187100+Kgeek33@users.noreply.github.com>
Co-authored-by: 𝕂𝕪𝕝𝕚𝕒𝕟 <164187100+Kgeek33@users.noreply.github.com>
Copy link

sonarqubecloud bot commented Apr 7, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.