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: make update fn take &ExectionContext & put update fn together #457

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

SteveLauC
Copy link
Member

Standards checklist:

  • The PR title is descriptive.
  • I have read CONTRIBUTING.md
  • The code compiles (cargo build)
  • The code passes rustfmt (cargo fmt)
  • The code passes clippy (cargo clippy)
  • The code passes tests (cargo test)
  • Optional: I have tested the code myself
    • I also tested that Topgrade skips the step where needed

If you developed a feature or a bug fix for someone else and you do not have the
means to test it, please tag this person here.


What does this PR do

  1. Update 4 update functions' argument to &ExectutionContext

  2. In main.rs, function run(), put all update functions together like this:

    #[cfg(windows)]
    { }
    #[cfg(target_os = "linux")]
    { }
    #[cfg(target_os = "macos")]
    { }
    #[cfg(target_os = "dragonfly")]
    { }
    #[cfg(target_os = "freebsd")]
    { }
    #[cfg(target_os = "openbsd")]
    { }
    #[cfg(target_os = "android")]
    { }
    #[cfg(unix)]
    { }
    #[cfg(not(any(
        target_os = "freebsd",
        target_os = "openbsd",
        target_os = "netbsd",
        target_os = "dragonfly"
    )))]
    { }

    so that contributors can easily find what is the appropriate place for their new update functions.

    One thing to note is that the order of these update functions being executed is changed and users may feel a little bit unfamiliar...

  3. In main.rs, make install_tracing() private as it is only used in main.rs

@s34m s34m merged commit 658829e into topgrade-rs:master Jun 2, 2023
@SteveLauC SteveLauC deleted the exection_context branch June 3, 2023 00:04
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