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

Add flag to allow multiple prefix() sections to not be automatically sorted #210

Merged
merged 3 commits into from
Aug 26, 2024

Conversation

DanWlker
Copy link
Contributor

@DanWlker DanWlker commented Jul 7, 2024

Add a command-line flag that, when enabled, skips sorting "prefix(" imports lexically, while still preserving the default sorting for other types of sections. By default the value is false so as to not change the default behavior of gci.

Fixes: #205

pkg/config/config.go Outdated Show resolved Hide resolved
@DanWlker
Copy link
Contributor Author

@daixiang0 Force pushed to sign commits, let me know if any additional changes are required. Thanks

@daixiang0
Copy link
Owner

Please fix DCO then we can make it land.

Copy link
Owner

@daixiang0 daixiang0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@daixiang0 daixiang0 merged commit 5e7f3e5 into daixiang0:master Aug 26, 2024
1 check passed
codeboten referenced this pull request in open-telemetry/opentelemetry-collector-contrib Sep 11, 2024
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/daixiang0/gci](https://redirect.github.com/daixiang0/gci)
| `v0.13.4` -> `v0.13.5` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fdaixiang0%2fgci/v0.13.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fdaixiang0%2fgci/v0.13.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fdaixiang0%2fgci/v0.13.4/v0.13.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fdaixiang0%2fgci/v0.13.4/v0.13.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>daixiang0/gci (github.com/daixiang0/gci)</summary>

###
[`v0.13.5`](https://redirect.github.com/daixiang0/gci/releases/tag/v0.13.5)

[Compare
Source](https://redirect.github.com/daixiang0/gci/compare/v0.13.4...v0.13.5)

#### What's Changed

- Add flag to allow multiple prefix() sections to not be automatically
sorted by [@&#8203;DanWlker](https://redirect.github.com/DanWlker) in
[https://github.com/daixiang0/gci/pull/210](https://redirect.github.com/daixiang0/gci/pull/210)
- Update standard library list for go 1.23 by
[@&#8203;silas](https://redirect.github.com/silas) in
[https://github.com/daixiang0/gci/pull/214](https://redirect.github.com/daixiang0/gci/pull/214)

#### New Contributors

- [@&#8203;DanWlker](https://redirect.github.com/DanWlker) made their
first contribution in
[https://github.com/daixiang0/gci/pull/210](https://redirect.github.com/daixiang0/gci/pull/210)
- [@&#8203;silas](https://redirect.github.com/silas) made their first
contribution in
[https://github.com/daixiang0/gci/pull/214](https://redirect.github.com/daixiang0/gci/pull/214)

**Full Changelog**:
daixiang0/gci@v0.13.4...v0.13.5

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any
time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41OS4yIiwidXBkYXRlZEluVmVyIjoiMzguNTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicmVub3ZhdGVib3QiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: opentelemetrybot <[email protected]>
Co-authored-by: Yang Song <[email protected]>
Zxilly pushed a commit to Zxilly/gci that referenced this pull request Nov 11, 2024
…sorted (daixiang0#210)

* Add no lex order for custom sections

Signed-off-by: DanWlker <[email protected]>

* Add tests

Signed-off-by: DanWlker <[email protected]>

* Invert check to decrease steps

Signed-off-by: DanWlker <[email protected]>

---------

Signed-off-by: DanWlker <[email protected]>
Signed-off-by: Zxilly <[email protected]>
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.

Multiple prefix() sections should not be automatically sorted
2 participants