Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classify pesterquirk #186

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

mocchapi
Copy link
Contributor

pretty large change, though mostly just reorganization of existing code;

  • Turns dataobjs.pesterQuirk into 6 separate classes (instead of all the functionality being in the single class):
    - quirks.PrefixPesterQuirk
    • quirks.SuffixPesterQuirk
    • quirks.ReplacePesterQuirk
    • quirks.RegexpPesterQuirk
    • quirks.RandomPesterQuirk
    • quirks.MispellerPesterQuirk
  • Adds quirks.PesterQuirkFactory to replace the original dataobjs.pesterQuirk constructor. It returns the appropriate object for the given dict's "type" value
  • Turns dataobjs.pesterQuirks into quirks.PesterQuirkCollection
  • Replaces single-character variable names wherever spotted
  • Turns quirks.ScriptQuirks into pyquirks.ScriptQuirks to resolve a newly created circular dependency & move the 2 script quirk classes into the same file

This is a somewhat risky move. i've confirmed that quirks run as expected for each type but this was not a super in depth test or anything, just added one of each & used the quirk tester. No logic outside of these classes has been changed though, calls to the original dataobj.pesterQuirk were changed to call quirks.PesterQuirkFactory instead which offers an identical interface.

should make the code much easier to maintain & extend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant