spf13

spf13

13x engineer • @golang Product Lead @Google • Prior EVP @Docker, @MongoDB, @Drupal board • @gohugoio, Cobra & spf13-vim creator

Member Since 11 years ago

@Google, NYC

Experience Points
1.08w
follower
Lessons Completed
78
follow
Lessons Completed
776
stars
Best Reply Awards
99
repos

68 contributions in the last year

Pinned
⚡ The Go programming language
⚡ The world’s fastest framework for building websites.
⚡ The ultimate vim distribution
⚡ A Commander for modern Go CLI interactions
⚡ Go configuration with fangs
⚡ A FileSystem Abstraction System for Go
Activity
Nov
28
20 hours ago
Activity icon
issue

spf13 issue comment twpayne/chezmoi

spf13
spf13

Custom data fields appear as all lowercase strings

Troubleshooting

  • I ran chezmoi doctor and fixed as many issues as possible and retried my command.
  • I have double checked the instructions for Installation and the Quickstart Guide.
  • I have search for previous issues that have been reported/opened, and none of them relate to my problem.

Failure to follow the troubleshooting steps (and to report information requested below), may make it difficult to provide the proper support required. Furthermore, your issue may be closed without reply, if the instructions were not properly followed.


Description of issue

I added this block in my .chezmoi.toml.tmpl:

[data]
   isLinux = {{if eq .chezmoi.os “linux”}}true{{else}}false{{end}}
   isMac = {{if eq .chezmoi.os “darwin”}}true{{else}}false{{end}}
   isUnix = {{if eq .chezmoi.os “linux” }}true{{else if eq .chezmoi.os “darwin”}}true{{else}}false{{end}}
   isWindows = {{if eq .chezmoi.os “windows”}}true{{else}}false{{end}}

The file that got generated is this one:

[data]
    isLinux = false
    isMac = true
    isUnix = true
    isWindows = false

But trying to use those variables doesn't work, unless I write them down all in lowercase, i.e islinux.

A quick note is that it looks like my system (macOS Mojave, 10.14.6) has a non case-sensitive file system, which might or might not be the cause of this. But I would like to not have to change that setting because this machine is my main programming device, and I am afraid changing that setting might cause other issues. Also, all other chezMoi data strings are cased correctly (like chezmoi.fullHostname)

EDIT: Looks like the same thing happens in WSL (Linux subsystem on Windows), so might not be related to the filesystem being case-sensitive.

I could also just use the .chezmoi.os data directly, but those data fields help me keep things more readable and avoid typos better.

Also, just wanted to say I really appreciate this software, it really helps me manage my dotfiles much better!

Command that failed

✔ sammy in ~/.local/share/chezmoi [master ↑·5| ✚ 2 … 11] 
17:28:00.3N $ cat .chezmoi.toml.tmpl 
[data]
    isLinux = {{if eq .chezmoi.os "linux"}}true{{else}}false{{end}}
    isMac = {{if eq .chezmoi.os "darwin"}}true{{else}}false{{end}}
    isUnix = {{if eq .chezmoi.os "linux" }}true{{else if eq .chezmoi.os "darwin"}}true{{else}}false{{end}}
    isWindows = {{if eq .chezmoi.os "windows"}}true{{else}}false{{end}}

✔ sammy in ~/.local/share/chezmoi [master ↑·5| ✚ 2 … 11] 
17:28:20.3N $ cat ~/.config/chezmoi/chezmoi.toml
[data]
    isLinux = false
    isMac = true
    isUnix = true
    isWindows = false

✔ sammy in ~/.local/share/chezmoi [master ↑·5| ✚ 2 … 11] 
17:28:33.3N $ chezmoi data
{
  "chezmoi": {
    "arch": "amd64",
    "fullHostname": "Sammys-Macbook-Pro.local",
    "group": "staff",
    "homedir": "/Users/sammy",
    "hostname": "Sammys-Macbook-Pro",
    "os": "darwin",
    "username": "sammy"
  },
  "islinux": false,
  "ismac": true,
  "isunix": true,
  "iswindows": false
}

Output of command with --verbose

✔ sammy in ~/.local/share/chezmoi [master ↑·5| ✚ 2 … 11] 
17:31:23.3N $ chezmoi data --verbose
{
  "chezmoi": {
    "arch": "amd64",
    "fullHostname": "Sammys-Macbook-Pro.local",
    "group": "staff",
    "homedir": "/Users/sammy",
    "hostname": "Sammys-Macbook-Pro",
    "os": "darwin",
    "username": "sammy"
  },
  "islinux": false,
  "ismac": true,
  "isunix": true,
  "iswindows": false
}

Output of chezmoi doctor

✔ sammy in ~/.local/share/chezmoi [master ↑·5| ✚ 2 … 11]
17:34:49.3N $ chezmoi doctor
    ok: version 1.7.2, commit 41c4fdc2faf1bf9f0ded922d1ea7724a838bca3f, built at 2019-10-17T00:29:03Z
    ok: /Users/sammy/.local/share/chezmoi (source directory, perm 700)
    ok: /Users/sammy (destination directory, perm 755)
    ok: /Users/sammy/.config/chezmoi/chezmoi.toml (configuration file)
    ok: /usr/local/bin/bash (shell)
    ok: /Applications/Visual Studio Code.app/Contents/Resources/app/bin/code (editor)
    ok: /usr/bin/vimdiff (merge command)
    ok: /usr/local/bin/git (source VCS command, version 2.23.0)
warning: gpg (GnuPG, not found)
    ok: /Users/sammy/bin/op (1Password CLI, version 0.6.2)
warning: bw (Bitwarden CLI, not found)
warning: gopass (gopass CLI, not found)
warning: keepassxc-cli (KeePassXC CLI, not found)
    ok: /usr/local/bin/lpass (LastPass CLI, version 1.3.3)
warning: pass (pass CLI, not found)
warning: vault (Vault CLI, not found)

Output of chezmoi --version

✘-1 sammy in ~/.local/share/chezmoi [master ↑·5| ✚ 2 … 11]
17:39:07.3N $ chezmoi --version
chezmoi version 1.7.2, commit 41c4fdc2faf1bf9f0ded922d1ea7724a838bca3f, built at 2019-10-17T00:29:03Z
spf13
spf13

I'm starting to use chezmoi so I'm interested in helping. No promises, but I'd like to help make things better.

Nov
27
1 day ago
started
started time in 1 day ago
Nov
26
2 days ago
Activity icon
issue

spf13 issue comment estruyf/vscode-front-matter

spf13
spf13

Issue: front matter is case sensitive

After a good amount of troubleshooting I found that the reason that several hundred of my articles were missing from the dashboard and the editing window was that front matter expects all fieldnames to be all lowercase or at least case sensitive.

Hugo doesn't have this requirement and it took me a long time to notice that the initial caps used in some front matter was causing FrontMatter to not parse the articles at all.

I'm not sure if this is a bug or not, but the behavior was surprising especially since it worked differently than Hugo does.

spf13
spf13

I think the diagnostic view would be generally quite useful. I'm not sure how broadly beneficial the latter one is, but I'd certainly benefit from it.

On Thu, Nov 25, 2021 at 2:53 AM Elio Struyf ***@wrote:

Two things that come to mind:

  • Diagnostic view, that gives an overview of all project/content details
  • A command that allows you to align all properties (convert to lowercase or camelcase). This way, you do not have to do it manually

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/estruyf/vscode-front-matter/issues/186#issuecomment-978920816, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABKKZBMLFGCSGE5VK57X5DUNXTRLANCNFSM5IUWQFNQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Nov
24
4 days ago
Activity icon
issue

spf13 issue comment estruyf/vscode-front-matter

spf13
spf13

Issue: front matter is case sensitive

After a good amount of troubleshooting I found that the reason that several hundred of my articles were missing from the dashboard and the editing window was that front matter expects all fieldnames to be all lowercase or at least case sensitive.

Hugo doesn't have this requirement and it took me a long time to notice that the initial caps used in some front matter was causing FrontMatter to not parse the articles at all.

I'm not sure if this is a bug or not, but the behavior was surprising especially since it worked differently than Hugo does.

spf13
spf13

The case sensitivity makes sense to me as the default (or only) behavior, and I'm ok with fixing all of mine to be consistent, but I think the larger issue was that a site that worked fine in Hugo with hundreds of posts, only showed about 25 posts in FrontMatter and there wasn't really an easy way to debug it. It took me a good while to discover that the initial caps were causing the issue. I troubleshooted several prior things I thought it might be before this and even dug around in the source code a bit.

I'm not sure what fields it looks for, but it might be a better experience to identify somewhere that there were articles found that didn't have the right fields (in this case they were just cased incorrectly) but had front matter and were parsed fine.

Nov
23
5 days ago
Activity icon
issue

spf13 issue estruyf/vscode-front-matter

spf13
spf13

Issue: front matter is case sensitive

After a good amount of troubleshooting I found that the reason that several hundred of my articles were missing from the dashboard and the editing window was that front matter expects all fieldnames to be all lowercase or at least case sensitive.

Hugo doesn't have this requirement and it took me a long time to notice that the initial caps used in some front matter was causing FrontMatter to not parse the articles at all.

I'm not sure if this is a bug or not, but the behavior was surprising especially since it worked differently than Hugo does.

Nov
20
1 week ago
Activity icon
issue

spf13 issue estruyf/vscode-front-matter

spf13
spf13

Enhancement: add support for different taxonomies

I'm new to the project but from my exploration so far it seems that Categories and Tags are hard coded. Hugo provides the option to define new taxonomies. It would be great if this was configurable or at the very least, re-nameable. For example, my website, spf13.com uses tags and topics. If I could just alias categories to topics that would address my needs, though other Hugo sites take deeper advantage of the configurable taxonomies.

started
started time in 1 week ago
Nov
18
1 week ago
Activity icon
issue

spf13 issue comment spf13/cobra

spf13
spf13

Docs for generating docs are 404

In this section: https://cobra.dev/#generating-documentation-for-your-command

The link to man page is a 404.

spf13
spf13

I'm supportive of all the proposals here.

Cobra is in maintenance mode in practice right now, but if we had more maintainers and an agreed upon roadmap with semi-regular releases we could entertain more feature development.. Though, to be honest, I'm not sure what major features would benefit our users that would need to be in the core framework... but I'm happy to have that discussion.

We can try to drum up more interest in Cobra maintenance and see what additional support we can get. A ton of projects use Cobra, and historically our big users have done a good job as maintainers.

On Wed, Nov 17, 2021 at 4:32 PM John McBride ***@wrote:

Cobra is more or less in maintenance mode.

This is a bit surprising to me, although, I agree that not much needs to be done or changed since the cobra library is so stable. And truthfully, I have been treating it as such; many of the fixes and PRs that get into releases are not net new features, but small, stable enhancements, project maintenance bits, security bumps, etc.

In my opinion, if we want to treat Cobra as a more stable / maintenance project, I think we need to draft something up for the community, close existing PRs that include major feature adds, etc. But I won't be the one to make that call. Steve, I'd like if you could handle that, make the decision, and communicate it to the community.

I think it's clear that the project could benefit from additional maintainers.

@spf13 https://github.com/spf13 In all honesty, I think cobra is in severe need of an injection of maintainers, at least to handle the influx of issues and pull requests. Right now, I believe I am the only one merging PRs or active as a maintainer. And even then I can't commit much more than a few hours a week, if that.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/spf13/cobra/issues/1527#issuecomment-972068121, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABKKZAOE5UZCPSZC4VRKJDUMQNQNANCNFSM5HQYNOPQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Nov
16
1 week ago
started
started time in 1 week ago
Nov
15
1 week ago
Activity icon
issue

spf13 issue comment spf13/cobra

spf13
spf13

Docs for generating docs are 404

In this section: https://cobra.dev/#generating-documentation-for-your-command

The link to man page is a 404.

spf13
spf13

@umarcor I think there is confusion here.

As @WhyNotHugo said, go quickstart would only replace the cli aspect of cobra.. as in the cobra generation tool. As it stands right now go quickstart is still only an idea without a roadmap and the team is very busy with generics, so I don't think this will happen anytime soon.

Cobra is among the most popular libraries in the entire Go ecosystem and is depended on by Go's largest projects & many huge enterprises including Google and Microsoft. Go.dev (which will soon be Go's official website) features Cobra in the use cases and the getting started section. With such a large adoption base and the initial goals largely reached, Cobra is more or less in maintenance mode.

I think the project would benefit strongly from an additional maintainer or two who understands that maintenance mode means accepting well tested fixes, but not accepting additional features unless they serve a broad set of users and reduce complexity.

I've spent a good amount of time and effort recruiting maintainers, and am grateful for all those who have contributed their time and talents to the project. Even with these efforts, I think it's clear that the project could benefit from additional maintainers.

Nov
11
2 weeks ago
started
started time in 2 weeks ago
Nov
9
2 weeks ago
push

spf13 push spf13/home_assistant_blueprints

spf13
spf13

Create binarysensor_activated_light.yaml

commit sha: f9aa76d79de162aadecabd31c1e2f309e14f4d97

push time in 2 weeks ago
Activity icon
created branch
createdAt 2 weeks ago
Nov
8
2 weeks ago
Activity icon
issue

spf13 issue comment fwestenberg/reolink_dev

spf13
spf13

Not able to log in

I can not login

tried create new user in camera no luck

updated to lates integration and latest HA version

keep saying Unexpected error

spf13
spf13

Figured out something. It works fine when I login as admin, but not as another user (even one with full admin rights).

Activity icon
issue

spf13 issue comment fwestenberg/reolink_dev

spf13
spf13

Not able to log in

I can not login

tried create new user in camera no luck

updated to lates integration and latest HA version

keep saying Unexpected error

spf13
spf13

I'm having the same issue after updating. Camera is RLC-820A.

Everything worked prior to upgrade. Upgraded and noticed that the new sensors we're available and the old motion sensor was unavailable. Removed one camera to re-add hoping it would add all the new sensors and now I can't add it. The other two cameras are still working, albeit without motion sensors.

Activity icon
issue

spf13 issue comment spf13/afero

spf13
spf13

Add GCS Fs implementation

An implementation of GCS Fs, based on https://github.com/spf13/afero/pull/161

Thanks @Zatte for the inital implementation!

Changes vs the original PR:

  • Based on the latest master
  • Uses client as its base abstraction, not bucket => bucket is thus a part of path, the first component in it (!)
  • Has kinks and quirks of the GCS API "ironed out"
  • Has its own test suite now, based off the TarFS one with extra parts to test the writing/folders making scenarios
  • The suite allows for testing both with mocks and with the real bucket (see commented out block in the tests setup)
  • File modes are exactly those that are provided during files/directories opening. If not provided, defaults to 0755

Bonus:

  • Supports gs://<bucket>/<path> URLs too, even though it's explicitly excluded from tests, since afero in general does not work with URLs.

The original PR notes, which still apply to this version of the implementation + extra for this version:

Limitations:

  • No Chmod support - The GCS ACL could probably be mapped to *nix style permissions but that would add another level of complexity and is ignored in this version.
  • No Chtimes support - Could be simulated with attributes (gcs a/m-times are set implicitly) but that's is left for another version.
  • NOTE: Not thread safe - Also assumes all file operations are done through the same instance of the GcsFs. File operations between different GcsFs instances are not guaranteed to be consistent.

Performance implications

  • Sequential reads are performant
  • Sequential writes are performant.
  • Seek + Read or ReadAt is performant after the initial seek. (produces a warning)
  • Alternating reads/writes to the same file handler are highly inefficient. To get consistent FS behavior using an API that separates readers and writers we close any open readers before an write as well close open writers before a read (ensure the data is committed).
  • Seek + Write such as WriteAt, Truncate, Seek+Write will work as expected but with significant overhead. Doing a seek + write will in effect download the old file/object, overlay it with the new writes and save it back. This is done in a streaming fashion so large files will not clog the memory but will trigger a full download and upload of the file/object.
spf13
spf13

No, I'd just add it to the documentation. It's not really usable without reading the documentation anyway as it requires unique configuration.

On Mon, Nov 8, 2021 at 9:41 AM Michalis Kargakis ***@wrote:

@spf13 https://github.com/spf13 can you be a bit more specific on how to mark this as experimental? Would creating an "experimental" subpackage where we can have gcs suffice?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/spf13/afero/pull/296#issuecomment-963227324, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABKKZCLB76SYRZ7XWSNHCDUK7OSJANCNFSM42ERP5UA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

pull request

spf13 merge to spf13/cobra

spf13
spf13

Support subcommands checking for suggestions

Resolves #636 Resolves #834 Resolves https://github.com/alexellis/arkade/issues/525

Till now, only the root command looked for suggestions. Now findSuggestions works for nested commands as well.

For example

Error: unknown command "rewin" for "root times"

Did you mean this?
	rewind

Run 'root times --help' for usage.
Activity icon
issue

spf13 issue comment spf13/cobra

spf13
spf13

Support subcommands checking for suggestions

Resolves #636 Resolves #834 Resolves https://github.com/alexellis/arkade/issues/525

Till now, only the root command looked for suggestions. Now findSuggestions works for nested commands as well.

For example

Error: unknown command "rewin" for "root times"

Did you mean this?
	rewind

Run 'root times --help' for usage.
spf13
spf13

Looks good to me. Would be a nice addition to the #1496

Activity icon
issue

spf13 issue comment spf13/afero

spf13
spf13

Add GCS Fs implementation

An implementation of GCS Fs, based on https://github.com/spf13/afero/pull/161

Thanks @Zatte for the inital implementation!

Changes vs the original PR:

  • Based on the latest master
  • Uses client as its base abstraction, not bucket => bucket is thus a part of path, the first component in it (!)
  • Has kinks and quirks of the GCS API "ironed out"
  • Has its own test suite now, based off the TarFS one with extra parts to test the writing/folders making scenarios
  • The suite allows for testing both with mocks and with the real bucket (see commented out block in the tests setup)
  • File modes are exactly those that are provided during files/directories opening. If not provided, defaults to 0755

Bonus:

  • Supports gs://<bucket>/<path> URLs too, even though it's explicitly excluded from tests, since afero in general does not work with URLs.

The original PR notes, which still apply to this version of the implementation + extra for this version:

Limitations:

  • No Chmod support - The GCS ACL could probably be mapped to *nix style permissions but that would add another level of complexity and is ignored in this version.
  • No Chtimes support - Could be simulated with attributes (gcs a/m-times are set implicitly) but that's is left for another version.
  • NOTE: Not thread safe - Also assumes all file operations are done through the same instance of the GcsFs. File operations between different GcsFs instances are not guaranteed to be consistent.

Performance implications

  • Sequential reads are performant
  • Sequential writes are performant.
  • Seek + Read or ReadAt is performant after the initial seek. (produces a warning)
  • Alternating reads/writes to the same file handler are highly inefficient. To get consistent FS behavior using an API that separates readers and writers we close any open readers before an write as well close open writers before a read (ensure the data is committed).
  • Seek + Write such as WriteAt, Truncate, Seek+Write will work as expected but with significant overhead. Doing a seek + write will in effect download the old file/object, overlay it with the new writes and save it back. This is done in a streaming fashion so large files will not clog the memory but will trigger a full download and upload of the file/object.
spf13
spf13

I think we should merge it now, but flag it as experimental until we can establish a more complete end2end test.

Nov
5
3 weeks ago
started
started time in 3 weeks ago
Nov
3
3 weeks ago
push

spf13 push spf13/cobra

spf13
spf13

Removing unused imports when not using Viper

spf13
spf13

Change generator to require opting in to viper.

Cobra and Viper are great together, but it's not uncommon to use them apart. New Cobra users don't know better and including Viper by default adds complexity to the skeleton.

spf13
spf13

Change generator default license to none

It's questionable that a default license makes any sense from a legal perspective. If the tool created the license without the user choosing it, then it may not even be applicable. Best to let the user choose their license with intent.

spf13
spf13

Cobra generator now works within Go modules

Pretty major change in behavior, but with modules a change is needed. Now cobra can initialize and add from within any Go module. The experience is simplified and streamlined, but requires go mod init to happen first.

spf13
spf13

Update documentation to reflect the module aware generator

spf13
spf13

Updating generator documentation and links

Merging the updated documentation from the user_guide into the cobra/README.md. Adding links as appropriate to both guides.

spf13
spf13

Simplifying goGet function

spf13
spf13

commit sha: bfacc59f62c67ffd43e93655a8d933cefab0fa99

push time in 3 weeks ago
pull request

spf13 pull request spf13/cobra

spf13
spf13

Module aware generator

The cobra tool needed some extra updating to make it work seamlessly within the world of Go modules.

I've dramatically simplified it to just work within a Go module. Now within a module you can just cobra init and it works. No paths or module names required.

I've also made two additional behavioral changes:

  1. Viper is no longer included by default. I've heard too much feedback from users that are confused by this and don't know where Cobra ends and Viper begins. Let's simplify that experience.
  2. There is no default license. There's questionable legal ramifications with choosing a license for users without their election. Better to have them take an action to set the license.
push

spf13 push spf13/cobra.dev

spf13
spf13

Add firebase target support

commit sha: 217e4782a4ce6ed6bb62709c7afa2ddc5a6f8821

push time in 3 weeks ago
Activity icon
published release Add support for targets

spf13 in spf13/deploy-firebase create published release Add support for targets

createdAt 3 weeks ago
Activity icon
created tag
createdAt 3 weeks ago
Previous