Giter Site home page Giter Site logo

black_out's Issues

[idea] Integrate with pre-commit

Nice work on this project! I've been looking for something like it for some time.

I'm wondering if the bot could be configured to run pre-commit. That way, it could do more than just format with black.

pre-commit + a GitHub bot would ensure that unformatted code never gets merged, and would take the burden off maintainers and contributors.

In an ideal world, unformatted code never gets committed because pre-commit prevents it. In a realistic world, contributors may forget to install the pre-commit hooks. The black_out bot would be the last resort, making the formatting commit for you.

Append a commit or rewrite all commits ?

(disclamer: rewriting history of merged commits is bad, I know, just exploring the idea for the sake of it)

In the one hand, rewriting history is bad. But in the other a huge big bang commit is equally bad for being able to use git blame and understanding where a commit comes from.

So I would find it interesting to be able to retrospectively blacken all commits in git history one by one in a PR. Or if you're YOLO, for the whole repo.

For the whole repo, this can be done with git filter-branch --tree-filter "git ls-files |xargs black" -- --all. (it a similar construct for a single PR with something instead of --all, probably <target-branch>..<pr-branch> but I haven't tried). But in real life you don't want to rewrite history of your whole repo, that would be bad.

This would mean the bot would rewrite commits but as far as I can tell, git filter-tree doesn't change the committer, so it wouldn't appear as co-author (we could add a Co-Authored-By` field, though). But, quite logically, this removes GPG signature from commits and tags. And rewriting the whole repo is madness, did I mention it ? Would be cool still. ๐Ÿ™ƒ

[idea] gradual shading of repo to black

What I mean is that high-volume, actively developed repos it might be unable to afford reformatting of the entire code base at once.
Instead, it would be less painful and non-blocking if bot could do blackening file by file or even better - update chunks and send new PRs once previous have been merged. It could even do bigger chucks against rarely changed code at the beginning and slow down and be more picky about the code someone is currently editing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.