-
Notifications
You must be signed in to change notification settings - Fork 0
Dev #11
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
Merged
Merged
Dev #11
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
34da21c
Ajouter un workflow de validation des titres de PR et un guide des co…
MXASoundNDEv 0a72e12
Ajout du support multilingue et de la normalisation pour l'algorithme…
MXASoundNDEv 8587e62
Add Fisher-Yates shuffle algorithm
MXASoundNDEv 2748341
Merge pull request #10 from MXASoundNDEv/codex/add-fisher-yates-shuff…
MXASoundNDEv 471eade
Ajout de la prise en charge des cartes personnalisées dans l'algorith…
MXASoundNDEv d525e59
Mise à jour de la version à 1.0.1 et mise à jour des dépendances js-yaml
MXASoundNDEv 3611e0a
Ajout de nouvelles fonctionnalités et d'algorithmes dans le README, y…
MXASoundNDEv dcc74df
Mise à jour de la version à 1.0.2 et ajout des améliorations dans le …
MXASoundNDEv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| name: 🔍 PR Title Validation | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, edited, synchronize] | ||
|
|
||
| jobs: | ||
| validate-title: | ||
| name: 📋 Validate PR Title Format | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: 📥 Checkout Code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: 🔍 Validate PR Title | ||
| env: | ||
| PR_TITLE: ${{ github.event.pull_request.title }} | ||
| run: | | ||
| echo "🔍 Validating PR title: '$PR_TITLE'" | ||
|
|
||
| # Pattern pour les conventions de commit | ||
| # Format: type(scope): description | ||
| if [[ "$PR_TITLE" =~ ^(feat|fix|docs|style|refactor|test|chore)(\([a-z0-9-]+\))?: .{1,50}$ ]]; then | ||
| echo "✅ PR title follows conventional format" | ||
| echo "## ✅ PR Title Validation" >> $GITHUB_STEP_SUMMARY | ||
| echo "Le titre de la PR suit les conventions du projet:" >> $GITHUB_STEP_SUMMARY | ||
| echo "\`$PR_TITLE\`" >> $GITHUB_STEP_SUMMARY | ||
| else | ||
| echo "❌ PR title should follow format: type(scope): description" | ||
| echo "Current title: $PR_TITLE" | ||
| echo "" | ||
| echo "Examples:" | ||
| echo " feat(autocomplete): add new autocompletion engine" | ||
| echo " fix(similarity): correct Levenshtein calculation" | ||
| echo " docs(readme): update API documentation" | ||
| echo "" | ||
| echo "Valid types: feat, fix, docs, style, refactor, test, chore" | ||
|
|
||
| # Ajouter au résumé GitHub | ||
| echo "## ❌ PR Title Validation Failed" >> $GITHUB_STEP_SUMMARY | ||
| echo "Le titre de la PR ne suit pas les conventions:" >> $GITHUB_STEP_SUMMARY | ||
| echo "\`$PR_TITLE\`" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "### 📋 Format attendu:" >> $GITHUB_STEP_SUMMARY | ||
| echo "\`type(scope): description\`" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "### ✅ Exemples valides:" >> $GITHUB_STEP_SUMMARY | ||
| echo "- \`feat(autocomplete): add new autocompletion engine\`" >> $GITHUB_STEP_SUMMARY | ||
| echo "- \`fix(similarity): correct Levenshtein calculation\`" >> $GITHUB_STEP_SUMMARY | ||
| echo "- \`docs(readme): update API documentation\`" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "### 🔧 Types valides:" >> $GITHUB_STEP_SUMMARY | ||
| echo "\`feat\`, \`fix\`, \`docs\`, \`style\`, \`refactor\`, \`test\`, \`chore\`" >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| exit 1 | ||
| fi | ||
|
|
||
| suggest-labels: | ||
| name: 🏷️ Suggest PR Labels | ||
| runs-on: ubuntu-latest | ||
| needs: validate-title | ||
| if: success() | ||
|
|
||
| steps: | ||
| - name: 🏷️ Analyze PR and Suggest Labels | ||
| env: | ||
| PR_TITLE: ${{ github.event.pull_request.title }} | ||
| PR_BODY: ${{ github.event.pull_request.body }} | ||
| run: | | ||
| echo "🏷️ Analyzing PR for label suggestions..." | ||
| echo "## 🏷️ Suggested Labels" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| # Extraire le type du titre | ||
| if [[ "$PR_TITLE" =~ ^(feat|fix|docs|style|refactor|test|chore) ]]; then | ||
| TYPE="${BASH_REMATCH[1]}" | ||
| echo "📌 Type: \`$TYPE\`" >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| case $TYPE in | ||
| "feat") | ||
| echo "- \`enhancement\`" >> $GITHUB_STEP_SUMMARY | ||
| echo "- \`feature\`" >> $GITHUB_STEP_SUMMARY | ||
| ;; | ||
| "fix") | ||
| echo "- \`bug\`" >> $GITHUB_STEP_SUMMARY | ||
| echo "- \`fix\`" >> $GITHUB_STEP_SUMMARY | ||
| ;; | ||
| "docs") | ||
| echo "- \`documentation\`" >> $GITHUB_STEP_SUMMARY | ||
| ;; | ||
| "test") | ||
| echo "- \`testing\`" >> $GITHUB_STEP_SUMMARY | ||
| ;; | ||
| "refactor") | ||
| echo "- \`refactoring\`" >> $GITHUB_STEP_SUMMARY | ||
| ;; | ||
| "style") | ||
| echo "- \`style\`" >> $GITHUB_STEP_SUMMARY | ||
| ;; | ||
| "chore") | ||
| echo "- \`maintenance\`" >> $GITHUB_STEP_SUMMARY | ||
| ;; | ||
| esac | ||
| fi | ||
|
|
||
| # Extraire le scope du titre | ||
| if [[ "$PR_TITLE" =~ \(([a-z0-9-]+)\) ]]; then | ||
| SCOPE="${BASH_REMATCH[1]}" | ||
| echo "🎯 Scope: \`$SCOPE\`" >> $GITHUB_STEP_SUMMARY | ||
| echo "- \`$SCOPE\`" >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
|
|
||
| # Analyser le contenu pour des labels supplémentaires | ||
| CONTENT="$PR_TITLE $PR_BODY" | ||
|
|
||
| if [[ $CONTENT =~ (test|testing|unit.test|integration.test) ]]; then | ||
| echo "- \`testing\`" >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
|
|
||
| if [[ $CONTENT =~ (performance|benchmark|optimization|faster) ]]; then | ||
| echo "- \`performance\`" >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
|
|
||
| if [[ $CONTENT =~ (breaking.change|breaking|major) ]]; then | ||
| echo "- \`breaking-change\`" >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
|
|
||
| if [[ $CONTENT =~ (security|vulnerability|CVE) ]]; then | ||
| echo "- \`security\`" >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
|
|
||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "💡 **Note**: Les labels doivent être ajoutés manuellement par un maintainer ayant les permissions appropriées." >> $GITHUB_STEP_SUMMARY | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,6 +5,42 @@ All notable changes to this project will be documented in this file. | |||||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||||||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||||||
|
|
||||||
| ## [1.0.2] - 2026-01-09 | ||||||
|
|
||||||
| ### Added | ||||||
| #### Algorithmes et Utilitaires | ||||||
| - **Fisher-Yates Shuffle** - Algorithme de mélange aléatoire déterministe de tableaux | ||||||
| - Fonction standalone `fisherYatesShuffle()` exportée | ||||||
| - Support des générateurs aléatoires personnalisés (RNG) | ||||||
| - Tests unitaires complets avec validation du déterminisme | ||||||
| - Définitions TypeScript complètes | ||||||
|
|
||||||
| #### Améliorations Soundex | ||||||
| - **Support des cartes personnalisées** - Possibilité de passer des mappings de caractères personnalisés | ||||||
| - Paramètre `customMap` pour définir des encodages phonétiques spécifiques | ||||||
| - Priorité donnée aux custom maps sur les maps de langue | ||||||
| - Tests de validation des mappings personnalisés | ||||||
| - **Support multilingue étendu** - Amélioration de la normalisation pour le français | ||||||
| - Normalisation des caractères accentués (é, è, ê, à, ù, etc.) | ||||||
| - Gestion du ç → s et œ → e | ||||||
| - Mappings spécifiques français (F et V → 7 au lieu de 1) | ||||||
| - Tests pour tous les cas de normalisation | ||||||
|
|
||||||
| ### Enhanced | ||||||
| - **Documentation README** | ||||||
| - Ajout d'un tableau de performance pour tous les algorithmes | ||||||
| - Section "Fonctionnalités" complète avec toutes les capacités de la bibliothèque | ||||||
| - Benchmarks détaillés (ops/s) pour petites, moyennes et grandes chaînes | ||||||
| - Performance du RandomEngine avec toutes ses fonctions | ||||||
| - **Tests unitaires** - 152 tests passant (amélioration de la couverture) | ||||||
|
||||||
| - **Tests unitaires** - 152 tests passant (amélioration de la couverture) | |
| - **Tests unitaires** - amélioration de la couverture de tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| module.exports = function fisherYatesShuffle(array, random = Math.random) { | ||
| const result = array.slice(); | ||
|
|
||
| for (let i = result.length - 1; i > 0; i--) { | ||
| const j = Math.floor(random() * (i + 1)); | ||
| [result[i], result[j]] = [result[j], result[i]]; | ||
| } | ||
|
|
||
| return result; | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR title "Dev" does not follow the conventional commit format that the newly added PR validation workflow enforces. According to the workflow validation regex on line 24, PR titles must follow the format "type(scope): description" (e.g., "feat(soundex): add multilingual support"). This PR will fail its own validation workflow.