Skip to content

Add Google-style docstrings and fix bugs in pg_cmd, pg_lock, pg_opt, …#93

Merged
zaihuaji merged 1 commit intohua-work-commonfrom
claude/naughty-lehmann
Mar 21, 2026
Merged

Add Google-style docstrings and fix bugs in pg_cmd, pg_lock, pg_opt, …#93
zaihuaji merged 1 commit intohua-work-commonfrom
claude/naughty-lehmann

Conversation

@zaihuaji
Copy link
Collaborator

…pg_split

pg_cmd.py:

  • Added docstrings to all methods and class
  • Fixed unescaped dot in dsid regex (r'^(ds\d|\d)\d\d.\d$' -> r'....\d$')
  • Fixed NoneType concatenation crash in get_dynamic_options when SYSERR is None

pg_lock.py:

  • Added docstrings to all methods and class
  • Fixed update_partition_lock: pid counter underflow (added max(0, ...))
  • Fixed update_partition_lock: potential KeyError on missing 'pid' key
  • Fixed update_partition_lock: inconsistent early-return value (0 -> None)
  • Fixed lock_process_info: implicit None check -> explicit is not None

pg_opt.py:

  • Added docstrings to all 40+ methods and class
  • Fixed set_sudo_uid/set_root_uid: self.params['CACT'] -> self.PGOPT['CACT']
  • Fixed set_sudo_uid/set_root_uid: missing closing quote in format strings
  • Fixed set_option_value: str builtin used instead of local variable dstr
  • Fixed validate_one_infile: == None -> is None
  • Fixed get_control_frequency: wrong return value on error (returned unit char instead of error message string)
  • Fixed append_format_string: unescaped regex metacharacters in fmt

pg_split.py:

  • Added docstrings to all methods and class
  • Fixed compare_wfile: [[]]*flen shallow copy bug (all fields shared one list)
  • Fixed compare_wfile: dsrecs.keys() live view -> list(dsrecs.keys())

…pg_split

pg_cmd.py:
- Added docstrings to all methods and class
- Fixed unescaped dot in dsid regex (r'^(ds\d|\d)\d\d.\d$' -> r'...\.\d$')
- Fixed NoneType concatenation crash in get_dynamic_options when SYSERR is None

pg_lock.py:
- Added docstrings to all methods and class
- Fixed update_partition_lock: pid counter underflow (added max(0, ...))
- Fixed update_partition_lock: potential KeyError on missing 'pid' key
- Fixed update_partition_lock: inconsistent early-return value (0 -> None)
- Fixed lock_process_info: implicit None check -> explicit is not None

pg_opt.py:
- Added docstrings to all 40+ methods and class
- Fixed set_sudo_uid/set_root_uid: self.params['CACT'] -> self.PGOPT['CACT']
- Fixed set_sudo_uid/set_root_uid: missing closing quote in format strings
- Fixed set_option_value: str builtin used instead of local variable dstr
- Fixed validate_one_infile: == None -> is None
- Fixed get_control_frequency: wrong return value on error (returned unit
  char instead of error message string)
- Fixed append_format_string: unescaped regex metacharacters in fmt

pg_split.py:
- Added docstrings to all methods and class
- Fixed compare_wfile: [[]]*flen shallow copy bug (all fields shared one list)
- Fixed compare_wfile: dsrecs.keys() live view -> list(dsrecs.keys())

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zaihuaji zaihuaji merged commit e785861 into hua-work-common Mar 21, 2026
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