-
Notifications
You must be signed in to change notification settings - Fork 0
Clean the code as fuck is possible #1
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
base: mainG
Are you sure you want to change the base?
Conversation
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
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
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
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified line R8
@@ -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(); |
… de produit dans le projet iOS
…raser l'appli original
… jour l'affichage des devoirs
…oirs (évite un plantage btw)
… meilleur lisibilité (PapillonApp#895)
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>
|
🚀 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].
TODO
(aka des annotations pour du code manquant) dans vos modificationsChangelogs proposés
Décrivez les modifications que vous avez effectuées.
Informations supplémentaires
Ajoutez ici toute information supplémentaire si nécessaire.