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

Refactor #152

Merged
merged 4 commits into from
Sep 3, 2023
Merged

Refactor #152

merged 4 commits into from
Sep 3, 2023

Conversation

savq
Copy link
Owner

@savq savq commented Aug 5, 2023

  • Use a loop to create Paq* commands.
  • Capitalize global variables to make them stand out more.
  • Refactor report and counter to have a similar signature.
  • Refactor the weird logic used to handle PaqSync messages.
  • Rename run option to build.
  • Rename PaqRunHook command to PaqBuild. Paq will print a deprecation notice if the old names are used. The reason for renaming is explained in Unable to run setup hook for gitsigns #143.
  • Refactor to ensure builds are executed after all packages have been installed/updated and loaded:
    • If the hook is a function, it might require a module inside a recently installed package.
    • If a is package is installed successfully and the build fails, it's better to notify that in two separate messages, instead of notifying the install failed.

NOTE: I removed from the PR the refactor to call_proc, since it didn't seem to be working correctly.

@saccarosium
Copy link
Collaborator

@savq little ping to remind you to merge this so I can work on the next items.

@savq savq changed the base branch from master to dev September 3, 2023 05:55
@savq savq force-pushed the refactor branch 2 times, most recently from 5e45ac6 to 8224bb7 Compare September 3, 2023 06:11
@savq savq marked this pull request as ready for review September 3, 2023 06:11
savq added 3 commits September 3, 2023 01:27
Public API:
- Rename `run` option to `build`.
- Rename `PaqRunHook` command to `PaqBuild`.

Paq will print a deprecation notice if the old names are used.
The reason for renaming these is explained in #143.

Internals:
- Refactor build related functions to ensure builds are executed after
  all packages have been installed/updated and loaded:
  - If the hook is a function, it might require a module inside a
    recently installed package.
  - If a is package is installed successfully and the build fails,
    it's better to notify that in two separate messages, instead of
    notifying the install failed.

- Rename `run_hook` to `run_build`, and refactor to make it clear
  there's 3 possible cases: function, ex command, shell commmand.

- Refactor `new_counter` to take a callback (passed in `exe_op`).
- Refactor `report` and `counter` to have (almost) the same signature.
- Refactor the weird logic used to handle `PaqSync` messages.
@savq savq merged commit e4f255f into dev Sep 3, 2023
@savq savq deleted the refactor branch September 3, 2023 06:30
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.

2 participants