Skip to content

Conversation

@shbhmexe
Copy link
Contributor

Summary

This PR fixes a few correctness and hygiene issues across the data-mining scripts:

  • Correctly pass the patch instance to credit methods (instead of the patch class reference)
  • Improve database utilities and defaults handling
  • Remove stale globals and minor formatting issues

What changed

  • Correct patch credit attribution

    • In src/gitdm.py and src/cncfdm.py, testcredit() / reportcredit() now receive the actual patch instance (p / pa) rather than the patch class.
  • Database utility + safer defaults

    • DumpDB() now closes database.dump after writing.
    • FileType.__init__() now avoids mutable default arguments; guess_file_type() now treats empty patterns/order as valid overrides (uses is not None instead of or).
    • MapToEmployer() now safely defaults to the email-based employer mapping when an unsupported unknown handling value is passed.
    • LookupEmployer() signature is intact (fixes an accidental broken definition).
  • CLI parsing cleanup

    • In src/gerritdm.py and src/lpdm.py, removed stale Aggregate from the global declaration in ParseOpts().
  • Minor report formatting

    • In src/reports.py, removed a trailing comma in a Pct() call.

Files changed

  • src/cncfdm.py
  • src/database.py
  • src/gerritdm.py
  • src/gitdm.py
  • src/lpdm.py
  • src/reports.py

- Pass the patch instance (not the patch class) to testcredit()/reportcredit() in gitdm.py and cncfdm.py
- Close the database dump file handle in DumpDB()
- Avoid mutable default args in FileType and treat empty patterns/order correctly
- Make MapToEmployer() handle unsupported `unknown` values safely by defaulting to email mapping
- Keep/restore LookupEmployer() signature (fix accidental syntax break)
- Remove stale `Aggregate` global declarations in gerritdm.py and lpdm.py
- Remove a trailing comma in reports.py Pct() call

Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
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