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

Refactored sys package with enhancements and new functionalities. #518

Merged
merged 5 commits into from
Dec 16, 2023
Merged

Conversation

l50
Copy link
Owner

@l50 l50 commented Dec 16, 2023

Added:

  • Added imports for bufio and sync to sys package.
  • Introduced SignalKill constant for immediate process termination.
  • Developed Cmd struct with fields for command execution and output handling.
  • Implemented RmRf function for robust path removal.
  • Created GetTempPath function for determining OS-specific temp directories.
  • Established new RunCmd method for executing commands with timeout and output.

Changed:

  • Moved Signal constants for improved code organization.
  • Updated RunCmd to utilize StdoutPipe and StderrPipe for output handling.
  • Enhanced RunCmd for error handling, including command timeouts.
  • Revised test cases for RunCommand and RunCommandWithTimeout.
  • Refactored test suite to accommodate new RunCmd implementation.

Removed:

  • Eliminated old test implementations for RunCommand and RunCommandWithTimeout.

Proposed Changes

Related Issue(s)

Testing

Documentation

Screenshots/GIFs (optional)

Checklist

  • Ran mage runprecommit locally and fixed any issues that arose.
  • Ran mage runtests locally and fixed any issues that arose.
  • Curated your commits so they are legible and easy to read and understand.
  • 🚀

@l50-renovate-bot l50-renovate-bot bot added area/github Changes made to github actions area/sys Changes made to system resources area/go-mod-sum Changes made to go.mod and go.sum labels Dec 16, 2023
**Added:**

- Added imports for bufio and sync to sys package.
- Introduced SignalKill constant for immediate process termination.
- Developed Cmd struct with fields for command execution and output handling.
- Implemented RmRf function for robust path removal.
- Created GetTempPath function for determining OS-specific temp directories.
- Established new RunCmd method for executing commands with timeout and output.

**Changed:**

- Moved Signal constants for improved code organization.
- Updated RunCmd to utilize StdoutPipe and StderrPipe for output handling.
- Enhanced RunCmd for error handling, including command timeouts.
- Revised test cases for RunCommand and RunCommandWithTimeout.
- Refactored test suite to accommodate new RunCmd implementation.

**Removed:**

- Eliminated old test implementations for RunCommand and RunCommandWithTimeout.
@l50-renovate-bot l50-renovate-bot bot added the area/pre-commit Changes made to pre-commit hooks label Dec 16, 2023
**Added:**

- Created a new custom pre-commit hook script `prettier.sh` to format JSON, YAML,
  and YML files using Prettier.

**Changed:**

- Updated GitHub Actions pre-commit workflow to use `mage runPreCommit` command
  instead of `pre-commit run --all-files`, enhancing the CI process.
- Modified `.pre-commit-config.yaml` to use the custom Prettier hook script
  for formatting instead of the standard Prettier mirror repository hook.

**Removed:**

- Removed the Prettier mirror repository hook from `.pre-commit-config.yaml`,
  replacing it with the custom implementation for better control over formatting.

These changes enhance code formatting consistency and improve the automation
in CI/CD pipeline through custom scripting and workflow adjustments.
@l50 l50 merged commit 0034b51 into main Dec 16, 2023
10 checks passed
@l50 l50 deleted the runcmd branch December 16, 2023 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/github Changes made to github actions area/go-mod-sum Changes made to go.mod and go.sum area/pre-commit Changes made to pre-commit hooks area/sys Changes made to system resources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant