awesome-ocap icon indicating copy to clipboard operation
awesome-ocap copied to clipboard

automated python / js refactoring for ocap discipline

Open dckc opened this issue 11 months ago • 3 comments

https://github.com/kensanata/mastodon-archive is a typical python project.

idea: teach aider about DisciplinedPython and have it refactor the code.

even crazier idea: interpret python ASTs using guile macros a la

  • https://github.com/cwebber/rockit/pull/4

dckc avatar Jan 24 '25 13:01 dckc

I had some luck using /web

/web https://github.com/dckc/awesome-ocap/wiki/DisciplinedPython /web https://github.com/dckc/awesome-ocap/wiki/OCap-Discipline /web https://en.wikipedia.org/wiki/Ambient_authority /web https://www.madmode.com/2019/python-eng.html

Details:

aider was tripping over PEP8 lint; I'm inclined to start again after using autopep8.

dckc avatar Jan 26 '25 04:01 dckc

I think LLMs (and humans) would benefit from a bunch of examples like the airbnb JS style guide:

// bad
import os

def main():
    os.xyz()

// good
def main(xyz):
    xyz()

if __name__ == '__main__':
    def _script():
        from os import xyz
        main(xyz=xyz)
    _script()

dckc avatar Feb 15 '25 14:02 dckc

TODO: restore CapPython to working order; use it to give feedback to LLMs.

dckc avatar May 28 '25 16:05 dckc