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

Restructuration readme FR #569

Merged
merged 14 commits into from
Feb 10, 2025
170 changes: 109 additions & 61 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,95 +1,143 @@
# Contribution guidelines
# 🤝 Contribuer

Contributing to this project should be as easy and transparent as possible, whether it's:
Contribuer à ce projet doit être aussi simple et transparent que possible, que ce soit pour :

- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Signaler un bug
- Discuter du code existant
- Proposer des corrections
- Suggérer de nouvelles fonctionnalités

## GitHub is used for everything
## 🚀 GitHub est utilisé pour tout

GitHub is used to host code, to track issues and feature requests, as well as accept pull requests.
GitHub est la plateforme principale pour héberger le code, suivre les problèmes et demandes de fonctionnalités, et accepter les pull requests.

Pull requests are the best way to propose changes to the codebase.
Les pull requests sont le meilleur moyen de proposer des modifications du code :

1. Fork the repo and create your branch from `master`.
2. If you've changed something, update the documentation.
3. Make sure your code lints (using black).
4. Test you contribution.
5. Issue that pull request!
1. **Créez un fork** du dépôt et créez votre branche à partir de `master`.
2. Si vous avez modifié quelque chose, mettez à jour la documentation.
3. Assurez-vous que votre code suit les règles de formatage (utilisation de `black`).
4. Testez votre contribution.
5. Soumettez une pull request !

## Any contributions you make will be under the MIT Software License
---

In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.
## 📜 Activer la journalisation de débogage

## Report bugs using GitHub's [issues](../../issues)
Si vous devez signaler un problème, il est recommandé d'activer la journalisation de débogage en ajoutant ceci dans votre fichier `configuration.yaml` :

GitHub's issues are used to track public bugs.
Report a bug by [opening a new issue](../../issues/new/choose); it's that easy!
```yaml
logger:
default: info
logs:
custom_components.hilo: debug
pyhilo: debug
```

---

## 🛠️ Préparer un environnement de développement via VSCode DevContainer

Pour faciliter le développement, un environnement est disponible via DevContainer de VSCode. Assurez-vous d'avoir **VSCode** et **Docker** installés sur votre ordinateur.

1. Ouvrez le dossier du projet dans VSCode.
2. Installez l'extension **Remote - Containers**.
3. Ouvrez la palette de commandes (**Ctrl+Shift+P** ou **Cmd+Shift+P**) et recherchez :
```
Remote-Containers: Reopen in Container
```
4. Attendez que l'environnement soit prêt.
5. Ouvrez un terminal dans VSCode et exécutez :
```bash
scripts/develop
```
pour installer les dépendances et lancer Home Assistant.
6. VSCode devrait vous proposer d'ouvrir un navigateur pour accéder à Home Assistant. Sinon, ouvrez manuellement :
```
http://localhost:8123
```
7. Effectuez la configuration initiale de Home Assistant.
8. Ajoutez l'intégration **Hilo** via l'interface utilisateur.
9. Modifiez les fichiers dans le dossier `custom_components/hilo` et observez les changements en temps réel dans Home Assistant.

Dans le terminal où vous avez lancé `scripts/develop`, les journaux de Home Assistant et de l'intégration Hilo devraient défiler.

---

## ✅ Avant de soumettre une Pull Request

Il est essentiel de tester vos modifications sur une installation locale. Vous pouvez modifier les fichiers `.py` de l'intégration directement dans votre dossier `custom_components/hilo`.

## Write bug reports with detail, background, and sample code
⚠ **N'oubliez pas votre copie de sauvegarde !**

**Great Bug Reports** tend to have:
Si vous devez modifier `python-hilo` pour vos tests, installez votre fork avec la commande suivante :

- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can.
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
- If you need to add logs, make sure debug log level is enabled in your home-assistant `configuration.yaml`:
```bash
pip install -e git+https://github.com/VOTRE_FORK_ICI/python-hilo.git#egg=python-hilo
```
logger:
default: info
logs:
custom_components.hilo: debug
pyhilo: debug

Redémarrez ensuite Home Assistant pour que l'installation prenne effet. Pour revenir en arrière :

```bash
pip install python-hilo
```

People _love_ thorough bug reports. I'm not even kidding.
Puis redémarrez Home Assistant.

---

## Use a Consistent Coding Style
## 🚀 Soumettre une Pull Request

Use [black](https://github.com/ambv/black) to make sure the code follows the style.
1. **Créez un fork** du dépôt dans votre espace utilisateur.
2. **Clonez-le** sur votre ordinateur.
3. Pour maintenir une certaine standardisation du code, nous utilisons des **linters** et des **validateurs** exécutés via des hooks `pre-commit` :

Or use the `pre-commit` settings implemented in this repository
(see dedicated section below).
```bash
pre-commit install --install-hooks
```

## Test your code modification
4. Apportez vos modifications au code.
5. Une fois terminé, ajoutez les fichiers modifiés :

This custom component is based on [integration_blueprint template](https://github.com/custom-components/integration_blueprint).
```bash
git add path/to/file
```

It comes with development environment in a container, easy to launch
if you use Visual Studio Code. With this container you will have a stand alone
Home Assistant instance running and already configured with the included
[`.devcontainer/configuration.yaml`](./.devcontainer/configuration.yaml)
file.
6. Créez un commit :

You can use the `pre-commit` settings implemented in this repository to have
linting tool checking your contributions (see dedicated section below).
```bash
git commit -m "J'ai changé ceci parce que ..."
```

## Pre-commit
7. Poussez les changements vers votre dépôt distant :

You can use the [pre-commit](https://pre-commit.com/) settings included in the
repository to have code style and linting checks.
```bash
git push
```

With `pre-commit` tool already installed,
activate the settings of the repository:
8. Sur le dépôt d'origine, **GitHub** devrait vous proposer de créer une **Pull Request** (PR). Suivez les instructions.

```console
$ pre-commit install
---

## 🛠️ Utiliser un style de code cohérent

Nous utilisons [black](https://github.com/psf/black) pour garantir un formatage uniforme du code. Vous pouvez également utiliser les paramètres `pre-commit` intégrés dans ce dépôt.

Pour activer `pre-commit` :

```bash
pre-commit install
```

Now the pre-commit tests will be done every time you commit.
Maintenant, les tests `pre-commit` seront exécutés à chaque commit.

You can run the tests on all repository file with the command:
Pour les exécuter manuellement sur tous les fichiers :

```console
$ pre-commit run --all-files
```bash
pre-commit run --all-files
```

## License
---

## 📜 Licence

By contributing, you agree that your contributions will be licensed under its MIT License.
En contribuant, vous acceptez que vos contributions soient sous licence MIT, comme le reste du projet. Pour plus d'informations, consultez la [licence MIT](http://choosealicense.com/licenses/mit/).
Loading