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

docs: update CONTRIBUTING.md & config.example.toml #458

Merged
merged 1 commit into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ In `topgrade`'s term, package manager is called `step`. To add a new `step` to
// ...

// Your new step here!
// You may want it to be sorted alphabetically becauses that looks great:)
// You may want it to be sorted alphabetically because that looks great:)
Xxx,
}
```
Expand Down Expand Up @@ -54,7 +54,8 @@ In `topgrade`'s term, package manager is called `step`. To add a new `step` to
Such a update function would be conventionally named `run_xxx()`, where `xxx`
is the name of the new step, and it should take a argument of type
`&ExecutionContext`, this is adequate for most cases unless some extra stuff is
needed (e.g., [you need to cleanup after update](https://github.com/topgrade-rs/topgrade/blob/cb7adc8ced8a77addf2cb051d18bba9f202ab866/src/steps/os/windows.rs#L56)).
needed (You can find some examples where extra arguments are needed
[here](https://github.com/topgrade-rs/topgrade/blob/7e48c5dedcfd5d0124bb9f39079a03e27ed23886/src/main.rs#L201-L219)).

Update function would usually do 3 things:
1. Check if the step is installed
Expand Down Expand Up @@ -84,7 +85,7 @@ In `topgrade`'s term, package manager is called `step`. To add a new `step` to

Congrats, you just added a new `step`:)

## Modification to the confiuration entries
## Modification to the configuration entries

If your PR has the configuration options
(in [`src/config.rs`](https://github.com/topgrade-rs/topgrade/blob/master/src/config.rs))
Expand Down Expand Up @@ -115,7 +116,7 @@ Don't worry about other platforms, we have most of them covered in our CI.
1. Locale

Some `step` respects locale, which means their output can be in language other
then English, we should not do check on it.
than English, we should not do check on it.

For example, one may want to check if a tool works by doing this:

Expand Down
2 changes: 1 addition & 1 deletion config.example.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Include any additional configuration file(s)
# [include] sections are processed in the order you write them
# Files in $CONFIG_DIR/topgrade/topgrade.d/ are automatically included at the beginning of this file
#[include]
[include]
#paths = ["/etc/topgrade.toml"]

[misc]
Expand Down