Page MenuHomePhabricator

Migrate cosmetic changes algorithms to fixes.py
Open, MediumPublic

Description

cosmetic_changes.py includes many custom algorithms to alter the page content, which is a similar concept to the fixes defined in fixes.py and performed in replace.py.

The replace.py 'fixes' logic and data can be merged into the cosmetic changes system, and integrated into the core library.

This eliminates the overlapping rules which appear in both fixes.py and cosmetic_changes.py, and will allow the bot operator more granular control over cosmetic changes applied on page save.

Event Timeline

jayvdb claimed this task.
jayvdb raised the priority of this task from to Medium.
jayvdb updated the task description. (Show Details)
jayvdb changed Security from none to None.
jayvdb subscribed.

The problem there is that fixes just uses regex.sub while cosmetic changes uses complex methods and functions. Also fixes has a edit summary for each entry while cosmetic changes has one for all. I guess we could change cosmetic changes into functions (which are then used from the toolkit) and fixes may then be either a iterable of regexes (and their replacement) or a callable.

Yes, we discussed this months ago , probably only on IRC. The fixes data structure needs to be expanded to include functionality needed by cosmetic changes.

Actually the discussion (at least partially, don't remember we talked on IRC about this) is in https://gerrit.wikimedia.org/r/#/c/187116/ .

Actually the discussion (at least partially, don't remember we talked on IRC about this) is in https://gerrit.wikimedia.org/r/#/c/187116/ .

Good find!