From: Cooper Lees Date: Sun, 17 May 2020 00:36:20 +0000 (-0700) Subject: Add primer CI tool ðŸī (#1402) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/b50a52708c564a9ded05b579e39eadbb928050a3?hp=b50a52708c564a9ded05b579e39eadbb928050a3 Add primer CI tool ðŸī (#1402) * Add primer CI tool ðŸ’Đ - Run in PATH `black` binary on configured projects - Can set wether we expect changes or not per project - Can set what python versions are supported for a project - if `long_checkout` True project will not be ran on CI Will add to CI after I finish unit tests to avoid silly bugs I'm sure I have ðŸĪŠ Tests: - Manual Run - Will add unit tests if people think it will be useful - Output: ```shell (b) cooper-mbp1:black cooper$ time /tmp/b/bin/black-primer -k -w /tmp/cooper_primer_1 [2020-05-10 08:48:25,696] INFO: 4 projects to run black over (lib.py:212) [2020-05-10 08:48:25,697] INFO: Skipping aioexabgp as it's disabled via config (lib.py:166) [2020-05-10 08:48:25,699] INFO: Skipping bandersnatch as it's disabled via config (lib.py:166) [2020-05-10 08:48:28,676] INFO: Analyzing results (lib.py:225) -- primer results 📊 -- 2 / 4 succeeded (50.0%) ✅ 0 / 4 FAILED (0.0%) ðŸ’Đ - 2 projects Disabled by config - 0 projects skipped due to Python Version - 0 skipped due to long checkout real 0m3.304s user 0m9.529s sys 0m1.019s ``` - ls of /tmp/cooper_primer_1 ``` (b) cooper-mbp1:black cooper$ ls -lh /tmp/cooper_primer_1 total 0 drwxr-xr-x 21 cooper wheel 672B May 10 08:48 attrs drwxr-xr-x 14 cooper wheel 448B May 10 08:48 flake8-bugbear ``` * Address mypy 3.6 type errors - Don't use asyncio.run() ... go back to the past :P - Refactor results into a named tuple of two dicts to avoid typing nightmare - Fix some variable names - Fix bug with rebase logic in git_checkout_or_rebase * Prettier the JSON config file for primer * Delete projects when finished, move dir to be timestamped + shallow copy * Re-enable disabled projects post @JelleZijlstra's docstring fix * Workaround for future annotations until someone tells me the correct fix ---