Closed jayvdb closed 3 years ago
Their list of transfomers
"AbsPathTransformer",
"AvailableAttrsTransformer",
"ContextDecoratorTransformer",
"ForceTextTransformer",
"HttpUrlQuotePlusTransformer",
"HttpUrlQuoteTransformer",
"HttpUrlUnQuotePlusTransformer",
"HttpUrlUnQuoteTransformer",
"InlineHasAddPermissionsTransformer",
"IsSafeUrlTransformer",
"LRUCacheTransformer",
"ModelsPermalinkTransformer",
"RenderToResponseTransformer",
"SmartTextTransformer",
"UGetTextLazyTransformer",
"UGetTextNoopTransformer",
"UGetTextTransformer",
"UNGetTextLazyTransformer",
"UNGetTextTransformer",
"URLTransformer",
"UnescapeEntitiesTransformer",
"UnicodeCompatibleTransformer",
A good starting point would be generating a list of ast differences between versions of Django, and store in a usable format.
https://github.com/radix/astdiff/blob/master/astdiff.py is first easy find on doing that.
Thanks for the notice, I hadn't heard about this package ; I'll discuss this on the django-codemod repository.
(Added a readme note about this other project)
This notice will do for now, alas we can't really share code due to how differently projects work (AST rewrite vs MonkeyPatching).
https://github.com/browniebroke/django-codemod does code rewriting , and many of their fixers are in the format
That structure is more re-usable metadata-ish, but they have far fewer fixers, so it would take a big effort to move all of the fixes here to there.
What would be more feasible is if this project used a more metadata-ish format for the 'easy' cases, ideally even a yaml file, and then django-codemod could load those from this project, and do their own thing for the entries which they can correctly parse/handle.