{"repo":"15r10nk/pysource-minimize","free":true,"listed":false,"github":"https://github.com/15r10nk/pysource-minimize","clone":"git clone https://github.com/15r10nk/pysource-minimize.git","description":"minimize python source code to find bugs more easily","language":"Python","stars":55,"topics":["code-generation","codegenerator","python","testing"],"license":"MIT","category":"dev-tools","readme_excerpt":"pysource-minimize If you build a linter, formatter or any other tool which has to analyse python source code you might end up searching bugs in pretty large input files. pysource minimize is able to remove everything from the python source which is not related to the problem. CLI You can use pysource-minimize from the command line like follow: This executes python bug.py and tries to find the string “Assertion” in the output. The ---file bug.py will be minimized as long as “assertion” is part of the output of the command. The --file option can be specified multiple times and there is also an --dir option which can be used to search directories recursively for Python files. [!WARNING] Be careful when you execute code which gets minimized. It might be that some combination of the code you minimize erases your hard drive or does other unintended things. API Example for single files: This example minimizes multiple files and searches for sets which have 2 common elements: You might think that there are no two zeros in the original sets. This problem can occur if your check function is not specific enough. pysource-minimize tries to minimize numbers and strings, does so for one of the sets and finds that it satisfies your check. It generates new code during the minimization and can only use the check function to know if the solution is correct. This kind of problem can be solved by using a more precise check function or a --track argument when using the CLI. For example, you can a","default_branch":null,"files":null,"tree":[],"storefront":"/r/15r10nk","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/15r10nk/pysource-minimize/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}