Trouvez toutes les exceptions que votre code et ses dépendances peuvent générer, afin de rendre votre code infaillible !
Report Bug
Connaissez-vous "l'effet démo" ? Le fait que votre code dûment testé échoue soudainement dès que vous le montrez à quelqu'un ? Souvent, c'est parce que vous avez oublié de gérer une exception à laquelle vous n'aviez pas pensé.
🪨 FoolProof identifie automatiquement les exceptions que votre code et ses dépendances peuvent déclencher, afin que vous ne soyez plus jamais pris au dépourvu !
foolproof est très simple à utiliser.
Installer foolproof avec pip :
pip install foolproofPour analyser un module entier mypackage, avec toutes les fonctions et méthodes qu'il contient, ajoutez ces lignes au début de votre code :
import mypackage
import foolproof
foolproof(mypackage)Vous pouvez également l'utiliser directement sur une fonction :
import foolproof
from mypackage import main
foolproof(main)Ideally, I would like to add more features to foolproof, but I don't have much time for it. If you want to contribute, you're more than welcome to do so!
| Task | Importance | Difficulty | Contributor on it | Description |
|---|---|---|---|---|
| Adding links to file | 5/5 | 5/5 | - | More than printing the raise command, we should print the link to the file in which the raise is used. This implies a major rework of foolproof, as the python ast does not keep the link between ast nodes and files. |
Contributing is an awesome way to learn, inspire, and help others. Any contributions you make are greatly appreciated, even if it's just about styling and best practices.
If you have a suggestion that would make this project better, please fork the repo and create a pull request.
Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/YourAmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Cette librairie a été crée par Nicolas MICAUX.
Une grande partie de ce code provient de https://github.com/DontShaveTheYak/deep-ast (https://pypi.org/project/deep-ast/)
Licence : GNU General Public License v3 (GPLv3)
Tous les crédits vont à Levi Blaney - @shady_cuz, shadycuz@gmail.com