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

feat: use (exported) consts for default styles #232

Merged
merged 3 commits into from
May 19, 2023
Merged

feat: use (exported) consts for default styles #232

merged 3 commits into from
May 19, 2023

Conversation

meowgorithm
Copy link
Member

While building an application with Glamour rendering, the linter suggested adding constants when "auto" appeared in several places in the codebase. To that end, this PR introduces string constants that can be used to reference the default styles.

  • AsciiStyle
  • AutoStyle
  • DarkStyle
  • DraculaStyle
  • LightStyle
  • NoTTYStyle
  • PinkStyle

Note that this revision uses the constants internally as well, however I have left the examples in the README as-is for sake of simplicity.

@meowgorithm meowgorithm requested a review from muesli May 18, 2023 18:09
glamour.go Outdated Show resolved Hide resolved
Copy link
Contributor

@muesli muesli left a comment

Choose a reason for hiding this comment

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

That seems so reasonable, I'm wondering why I didn't do that in the first place. Thanks @meowgorithm!

@meowgorithm meowgorithm merged commit 7528eaa into master May 19, 2023
@meowgorithm meowgorithm deleted the consts branch May 19, 2023 13:14
hogo6002 referenced this pull request in google/osv-scanner Mar 27, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change | Age | Adoption | Passing |
Confidence |
|---|---|---|---|---|---|---|---|
| [deps.dev/api/v3](https://togithub.com/google/deps.dev) | require |
digest | `81f5387` -> `ff53416` | | | | |
|
[github.com/charmbracelet/glamour](https://togithub.com/charmbracelet/glamour)
| require | minor | `v0.6.0` -> `v0.7.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fcharmbracelet%2fglamour/v0.7.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fcharmbracelet%2fglamour/v0.7.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fcharmbracelet%2fglamour/v0.6.0/v0.7.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fcharmbracelet%2fglamour/v0.6.0/v0.7.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[github.com/jedib0t/go-pretty/v6](https://togithub.com/jedib0t/go-pretty)
| require | patch | `v6.5.5` -> `v6.5.6` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fjedib0t%2fgo-pretty%2fv6/v6.5.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fjedib0t%2fgo-pretty%2fv6/v6.5.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fjedib0t%2fgo-pretty%2fv6/v6.5.5/v6.5.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fjedib0t%2fgo-pretty%2fv6/v6.5.5/v6.5.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[github.com/owenrumney/go-sarif/v2](https://togithub.com/owenrumney/go-sarif)
| require | patch | `v2.3.0` -> `v2.3.1` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fowenrumney%2fgo-sarif%2fv2/v2.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fowenrumney%2fgo-sarif%2fv2/v2.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fowenrumney%2fgo-sarif%2fv2/v2.3.0/v2.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fowenrumney%2fgo-sarif%2fv2/v2.3.0/v2.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| golang.org/x/exp | require | digest | `c7f7c64` -> `a685a6e` | | | | |

---

### Release Notes

<details>
<summary>charmbracelet/glamour
(github.com/charmbracelet/glamour)</summary>

###
[`v0.7.0`](https://togithub.com/charmbracelet/glamour/releases/tag/v0.7.0)

[Compare
Source](https://togithub.com/charmbracelet/glamour/compare/v0.6.0...v0.7.0)

#### Fixed

- Render URLs in table by
[@&#8203;brianstrauch](https://togithub.com/brianstrauch) in
[https://github.com/charmbracelet/glamour/pull/248](https://togithub.com/charmbracelet/glamour/pull/248)
- Align GitHub flavoured Tables by
[@&#8203;maaslalani](https://togithub.com/maaslalani) in
[https://github.com/charmbracelet/glamour/pull/284](https://togithub.com/charmbracelet/glamour/pull/284)

#### Changes

- feat: use (exported) consts for default styles by
[@&#8203;meowgorithm](https://togithub.com/meowgorithm) in
[https://github.com/charmbracelet/glamour/pull/232](https://togithub.com/charmbracelet/glamour/pull/232)
- Bump github.com/alecthomas/chroma/v2 from 2.7.0 to 2.8.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/charmbracelet/glamour/pull/243](https://togithub.com/charmbracelet/glamour/pull/243)

#### New Contributors

- [@&#8203;garymh](https://togithub.com/garymh) made their first
contribution in
[https://github.com/charmbracelet/glamour/pull/222](https://togithub.com/charmbracelet/glamour/pull/222)
- [@&#8203;Benicas](https://togithub.com/Benicas) made their first
contribution in
[https://github.com/charmbracelet/glamour/pull/251](https://togithub.com/charmbracelet/glamour/pull/251)
- [@&#8203;brianstrauch](https://togithub.com/brianstrauch) made their
first contribution in
[https://github.com/charmbracelet/glamour/pull/248](https://togithub.com/charmbracelet/glamour/pull/248)

**Full Changelog**:
charmbracelet/glamour@v0.6.0...v0.7.0

***

<a href="https://charm.sh/"><img alt="The Charm logo"
src="https://stuff.charm.sh/charm-badge.jpg" width="400"></a>

Thoughts? Questions? We love hearing from you. Feel free to reach out on
[Twitter](https://twitter.com/charmcli), [The
Fediverse](https://mastodon.social/@&#8203;charmcli), or
[Discord](https://charm.sh/chat).

</details>

<details>
<summary>jedib0t/go-pretty (github.com/jedib0t/go-pretty/v6)</summary>

###
[`v6.5.6`](https://togithub.com/jedib0t/go-pretty/releases/tag/v6.5.6)

[Compare
Source](https://togithub.com/jedib0t/go-pretty/compare/v6.5.5...v6.5.6)

#### What's Changed

- text: remove unused regular expression by
[@&#8203;jedib0t](https://togithub.com/jedib0t) in
[https://github.com/jedib0t/go-pretty/pull/308](https://togithub.com/jedib0t/go-pretty/pull/308)
- Allow alphanumerical sort to be case-insensitive by
[@&#8203;Skeeve](https://togithub.com/Skeeve) in
[https://github.com/jedib0t/go-pretty/pull/309](https://togithub.com/jedib0t/go-pretty/pull/309)
- table: note about auto-merge and HTML/Markdown modes by
[@&#8203;jedib0t](https://togithub.com/jedib0t) in
[https://github.com/jedib0t/go-pretty/pull/311](https://togithub.com/jedib0t/go-pretty/pull/311)

**Full Changelog**:
jedib0t/go-pretty@v6.5.5...v6.5.6

</details>

<details>
<summary>owenrumney/go-sarif
(github.com/owenrumney/go-sarif/v2)</summary>

###
[`v2.3.1`](https://togithub.com/owenrumney/go-sarif/releases/tag/v2.3.1)

[Compare
Source](https://togithub.com/owenrumney/go-sarif/compare/v2.3.0...v2.3.1)

#### What's Changed

- Bump github.com/zclconf/go-cty from 1.14.0 to 1.14.1 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/owenrumney/go-sarif/pull/72](https://togithub.com/owenrumney/go-sarif/pull/72)
- remove ioutil, use testing.TempDir by
[@&#8203;arukiidou](https://togithub.com/arukiidou) in
[https://github.com/owenrumney/go-sarif/pull/73](https://togithub.com/owenrumney/go-sarif/pull/73)
- Bump github.com/zclconf/go-cty from 1.14.1 to 1.14.2 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/owenrumney/go-sarif/pull/74](https://togithub.com/owenrumney/go-sarif/pull/74)
- Bump github.com/stretchr/testify from 1.8.4 to 1.9.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/owenrumney/go-sarif/pull/76](https://togithub.com/owenrumney/go-sarif/pull/76)
- Bump github.com/zclconf/go-cty from 1.14.2 to 1.14.3 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/owenrumney/go-sarif/pull/75](https://togithub.com/owenrumney/go-sarif/pull/75)
- Bump github.com/zclconf/go-cty from 1.14.3 to 1.14.4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/owenrumney/go-sarif/pull/77](https://togithub.com/owenrumney/go-sarif/pull/77)

#### New Contributors

- [@&#8203;arukiidou](https://togithub.com/arukiidou) made their first
contribution in
[https://github.com/owenrumney/go-sarif/pull/73](https://togithub.com/owenrumney/go-sarif/pull/73)

**Full Changelog**:
owenrumney/go-sarif@v2.3.0...v2.3.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 6am on monday" in timezone
Australia/Sydney, 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.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

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

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/google/osv-scanner).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
jaredallard referenced this pull request in rgst-io/stencil Mar 29, 2024
)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[github.com/charmbracelet/glamour](https://togithub.com/charmbracelet/glamour)
| `v0.6.0` -> `v0.7.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fcharmbracelet%2fglamour/v0.7.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fcharmbracelet%2fglamour/v0.7.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fcharmbracelet%2fglamour/v0.6.0/v0.7.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fcharmbracelet%2fglamour/v0.6.0/v0.7.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>charmbracelet/glamour
(github.com/charmbracelet/glamour)</summary>

###
[`v0.7.0`](https://togithub.com/charmbracelet/glamour/releases/tag/v0.7.0)

[Compare
Source](https://togithub.com/charmbracelet/glamour/compare/v0.6.0...v0.7.0)

#### Fixed

- Render URLs in table by
[@&#8203;brianstrauch](https://togithub.com/brianstrauch) in
[https://github.com/charmbracelet/glamour/pull/248](https://togithub.com/charmbracelet/glamour/pull/248)
- Align GitHub flavoured Tables by
[@&#8203;maaslalani](https://togithub.com/maaslalani) in
[https://github.com/charmbracelet/glamour/pull/284](https://togithub.com/charmbracelet/glamour/pull/284)

#### Changes

- feat: use (exported) consts for default styles by
[@&#8203;meowgorithm](https://togithub.com/meowgorithm) in
[https://github.com/charmbracelet/glamour/pull/232](https://togithub.com/charmbracelet/glamour/pull/232)
- Bump github.com/alecthomas/chroma/v2 from 2.7.0 to 2.8.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/charmbracelet/glamour/pull/243](https://togithub.com/charmbracelet/glamour/pull/243)

#### New Contributors

- [@&#8203;garymh](https://togithub.com/garymh) made their first
contribution in
[https://github.com/charmbracelet/glamour/pull/222](https://togithub.com/charmbracelet/glamour/pull/222)
- [@&#8203;Benicas](https://togithub.com/Benicas) made their first
contribution in
[https://github.com/charmbracelet/glamour/pull/251](https://togithub.com/charmbracelet/glamour/pull/251)
- [@&#8203;brianstrauch](https://togithub.com/brianstrauch) made their
first contribution in
[https://github.com/charmbracelet/glamour/pull/248](https://togithub.com/charmbracelet/glamour/pull/248)

**Full Changelog**:
charmbracelet/glamour@v0.6.0...v0.7.0

***

<a href="https://charm.sh/"><img alt="The Charm logo"
src="https://stuff.charm.sh/charm-badge.jpg" width="400"></a>

Thoughts? Questions? We love hearing from you. Feel free to reach out on
[Twitter](https://twitter.com/charmcli), [The
Fediverse](https://mastodon.social/@&#8203;charmcli), or
[Discord](https://charm.sh/chat).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
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 has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/rgst-io/stencil).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

3 participants