{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":565188618,"defaultBranch":"main","name":"cobra","ownerLogin":"formancehq","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2022-11-12T16:05:24.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/84325077?v=4","public":true,"private":false,"isOrgOwned":true},"refInfo":{"name":"","listCacheKey":"v0:1710501571.0","currentOid":""},"activityList":{"items":[{"before":"bfd8d9bb30ec640dd6fe14f6b76a2dbdebacfa17","after":null,"ref":"refs/heads/feat/update_cobra","pushedAt":"2024-03-15T11:19:31.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"Dav-14","name":"RAGOT David","path":"/Dav-14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/35502263?s=80&v=4"}},{"before":"60a6d6d55ef929d2117ab0ae8fdc1b33329e001d","after":"ca456bf9cac906447a1786cd981facdf0e8bba26","ref":"refs/heads/main","pushedAt":"2024-03-15T11:19:24.000Z","pushType":"pr_merge","commitsCount":1,"pusher":{"login":"Dav-14","name":"RAGOT David","path":"/Dav-14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/35502263?s=80&v=4"},"commit":{"message":"feat: update cobra (#1)\n\n* Create unit test illustrating unknown flag bug (#1854)\r\n\r\nCreated a unit test that tests the unknown flag\r\nerror message when the unknown flag is located\r\nin different arg positions.\r\n\r\n* Update stale.yml (#1863)\r\n\r\n* fix: force ForEach-Object to return array in pwsh completion (#1850)\r\n\r\nFixes #1847\r\n\r\n* Makefile: add target richtest (#1865)\r\n\r\nDon't require contributors to install richgo but keep it as an option and for CI\r\n\r\n* build(deps): bump golangci/golangci-lint-action from 3.2.0 to 3.3.1 (#1851)\r\n\r\nBumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.2.0 to 3.3.1.\r\n- [Release notes](https://github.com/golangci/golangci-lint-action/releases)\r\n- [Commits](https://github.com/golangci/golangci-lint-action/compare/v3.2.0...v3.3.1)\r\n\r\n---\r\nupdated-dependencies:\r\n- dependency-name: golangci/golangci-lint-action\r\n dependency-type: direct:production\r\n update-type: version-update:semver-minor\r\n...\r\n\r\nSigned-off-by: dependabot[bot] \r\nCo-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>\r\n\r\n* Update kubescape org (#1874)\r\n\r\nSigned-off-by: David Wertenteil \r\n\r\n* ci: deprecate go 1.15 (#1866)\r\n\r\nRemove testing for go 1.15 to allow CI to pass, but don't force projects to upgrade.\r\n\r\n* fix: conflict import name with variable (#1879)\r\n\r\n`template` is an import in `cobra.go` file and also used as a variable\r\nname, which masks the library in the scope of that function.\r\n\r\n* Update badge route (#1884)\r\n\r\nBased on\r\nhttps://github.com/badges/shields/issues/8671\r\n\r\n* fix: func name in doc strings (#1885)\r\n\r\nCorrected the function name at the start of doc strings, as per the convention\r\noutlined in official go documentation: https://go.dev/blog/godoc\r\n\r\n* completions: do not detect arguments with dash as 2nd char as flag (#1817)\r\n\r\nFixes #1816\r\n\r\nPreviously, arguments with a dash as the second character (e.g., 1-ff00:0:1)\r\nwere detected as a flag by mistake. This resulted in auto completion misbehaving\r\nif such an argument was last in the argument list during invocation.\r\n\r\n* build(deps): bump github.com/inconshreveable/mousetrap (#1872)\r\n\r\n* Add documentation about disabling completion descriptions (#1901)\r\n\r\n* Improve MarkFlagsMutuallyExclusive example in User Guide (#1904)\r\n\r\n* Update shell_completions.md (#1907)\r\n\r\nalign documentation with the code : completions.go:452\r\n\r\n* build(deps): bump golangci/golangci-lint-action from 3.3.1 to 3.4.0 (#1902)\r\n\r\n* Removes stale bot from GitHub action (#1908)\r\n\r\nSigned-off-by: John McBride \r\n\r\n* Add keeporder to shell completion (#1903)\r\n\r\nThis allows programs to request the shell to maintain the order of completions that was returned by the program\r\n\r\n* Add support for PowerShell 7.2+ (#1916)\r\n\r\nPowerShell 7.2 has changed the way arguments are passed to executables.\r\nThis was originally an experimental feature in 7.2, but as of 7.3 it is\r\nbuilt-in. A simple \"\" is now sufficient for passing empty arguments, no\r\nback-tick escaping is required.\r\n\r\nFixes #1849\r\n\r\nSigned-off-by: Oldřich Jedlička \r\nCo-authored-by: Oldřich Jedlička \r\n\r\n* ci: deprecate go 1.16 (#1926)\r\n\r\n* ci: test Golang 1.20 (#1925)\r\n\r\n* update copyright year (#1927)\r\n\r\n* Update projects_using_cobra.md (#1932)\r\n\r\nSigned-off-by: Florent Poinsard \r\n\r\n* Document suggested layout for subcommands (#1930)\r\n\r\nSigned-off-by: Luiz Carvalho \r\n\r\n* Allow sourcing zsh completion script (#1917)\r\n\r\nAlthough it is not the recommended approach, sourcing a completion\r\nscript is the simplest way to get people to try using shell completion.\r\nNot allowing it for zsh has turned out to complicate shell completion\r\nadoption. Further, many tools modify the zsh script to allow sourcing.\r\n\r\nThis commit allows sourcing of the zsh completion script.\r\n\r\nSigned-off-by: Marc Khouzam \r\n\r\n* Update main image to better handle dark background (#1883)\r\n\r\nFixes #1880\r\n\r\nSigned-off-by: Marc Khouzam \r\nCo-authored-by: Deleplace \r\n\r\n* Fix typo in fish completions (#1945)\r\n\r\n* build(deps): bump golangci/golangci-lint-action from 3.4.0 to 3.5.0 (#1971)\r\n\r\n* Fix grammar: 'allows to' (#1978)\r\n\r\nThe use in generated bash completion files is getting flagged by\r\nLintian (the Debian package linting tool).\r\n\r\nSigned-off-by: Taavi Väänänen \r\n\r\n* test: make fish_completions_test more robust (#1980)\r\n\r\nUse temporary files instead of assuming the current directory is\r\nwritable. Also, if creating a temporary file still returns an error,\r\nprevent the test from failing silently by replacing `log.Fatal` with\r\n`t.Fatal`.\r\n\r\n* powershell: escape variable with curly brackets (#1960)\r\n\r\nThis fixes an issue with program names that include a dot, in our case\r\n`podman.exe`. This was caused by the change in commit 6ba7ebbc.\r\n\r\nFixes #1853\r\n\r\nSigned-off-by: Paul Holzinger \r\n\r\n* build(deps): bump golangci/golangci-lint-action from 3.5.0 to 3.6.0 (#1976)\r\n\r\n* Move documentation sources to site/content (#1428)\r\n\r\n* Add 'one required flag' group (#1952)\r\n\r\n* golangci: enable 'unused' and disable deprecated replaced by it (#1983)\r\n\r\n* doc: fix typo, Deperecated -> Deprecated (#2000)\r\n\r\n* minor corrections to unit tests (#2003)\r\n\r\n* build(deps): bump golangci/golangci-lint-action from 3.6.0 to 3.7.0 (#2021)\r\n\r\n* command: temporarily disable G602 due to securego/gosec#1005 (#2022)\r\n\r\n* ci: test golang 1.21 (#2024)\r\n\r\n* Customizable error message prefix (#2023)\r\n\r\n* feat: add getters for flag completions (#1943)\r\n\r\n* Add notes to doc on preRun and postRun condition (#2041)\r\n\r\n* build(deps): bump actions/setup-go from 3 to 4 (#1934)\r\n\r\n* build(deps): bump github.com/cpuguy83/go-md2man/v2 from 2.0.2 to 2.0.3 (#2047)\r\n\r\n* Allow running persistent run hooks of all parents (#2044)\r\n\r\nCurrently, only one of the persistent pre-runs and post-runs is executed.\r\nIt is always the first one found in the parents chain, starting at this command.\r\nExpected behavior is to execute all parents' persistent pre-runs and post-runs.\r\n\r\nDependent projects implemented various workarounds for this:\r\n- manually building persistent hook chains (in every hook).\r\n- applying some kind of monkey-patching on top of Cobra.\r\n\r\nThis change eliminates the necessity for such workarounds\r\nby allowing to set a global variable EnableTraverseRunHooks.\r\n\r\nTickets:\r\n- https://github.com/spf13/cobra/issues/216\r\n- https://github.com/spf13/cobra/issues/252\r\n\r\nSigned-off-by: Volodymyr Khoroz \r\n\r\n* Fix linter errors (#2052)\r\n\r\nWhen using golangci-lint v1.55.0 some new errors were being reported.\r\n\r\nSigned-off-by: Marc Khouzam \r\n\r\n* Don't complete --help flag when flag parsing disabled (#2061)\r\n\r\nFixes #2060\r\n\r\nWhen a command sets `DisableFlagParsing = true` it requests the\r\nresponsibility of doing all the flag parsing. Therefore even the\r\n`--help/-f/--version/-v` flags should not be automatically completed\r\nby Cobra in such a case.\r\n\r\nWithout this change the `--help/-h/--version/-v` flags can end up being\r\ncompleted twice for plugins: one time from cobra and one time from the\r\nplugin (which has set `DisableFlagParsing = true`).\r\n\r\nSigned-off-by: Marc Khouzam \r\n\r\n* Add tests for flag completion registration (#2053)\r\n\r\nDifferent problems have been reported about flag completion registration.\r\nThese two tests are the cases that were not being verified but had been\r\nmentioned as problematic.\r\n\r\nRef:\r\n- https://github.com/spf13/cobra/issues/1320\r\n- https://github.com/spf13/cobra/pull/1438#issuecomment-872928669\r\n\r\nSigned-off-by: Marc Khouzam \r\n\r\n* Replace all non-alphanumerics in active help env var program prefix (#1940)\r\n\r\n* Replace all non-alphanumerics in active help env var program prefix\r\n\r\nThere are other characters besides the dash that are fine in program\r\nnames, but are problematic in environment variable names. These include\r\n(but are not limited to) period, space, and non-ASCII letters.\r\n\r\n* Another change in docs to mention non-ASCII-alphanumeric instead of just dash\r\n\r\n* build(deps): bump actions/checkout from 3 to 4 (#2028)\r\n\r\n* Support usage as plugin for tools like kubectl (#2018)\r\n\r\nIn this case the executable is `kubectl-plugin`, but we run it as:\r\n\r\n kubectl plugin\r\n\r\nAnd the help text should reflect the actual usage of the command.\r\n\r\nTo create a plugin, add the cobra.CommandDisplayNameAnnotation:\r\n\r\n rootCmd := &cobra.Command{\r\n Use: \"plugin\",\r\n Annotations: map[string]string{\r\n cobra.CommandDisplayNameAnnotation: \"kubectl plugin\",\r\n }\r\n }\r\n\r\nInternally this change modifies CommandPath() for the root command to\r\nreturn the command display name instead of the command name. This is\r\nused for error messages, help text generation, and completions.\r\n\r\nCommandPath() is expected to have spaces and code using it already\r\nhandle spaces (e.g replacing with _), so hopefully this does not break\r\nanything.\r\n\r\nFixes: #2017\r\n\r\nSigned-off-by: Nir Soffer \r\n\r\n* Improve API to get flag completion function (#2063)\r\n\r\nThe new API is simpler and matches the `c.RegisterFlagCompletionFunc()`\r\nAPI. By removing the global function `GetFlagCompletion()` we are more\r\nfuture proof if we ever move from a global map of flag completion\r\nfunctions to something associated with the command.\r\n\r\nThe commit also makes this API work with persistent flags by using\r\n`c.Flag(flagName)` instead of `c.Flags().Lookup(flagName)`.\r\n\r\nThe commit also adds unit tests.\r\n\r\nSigned-off-by: Marc Khouzam \r\n\r\n* feat: expose GetCompletions (was getCompletions)\r\n\r\n---------\r\n\r\nSigned-off-by: dependabot[bot] \r\nSigned-off-by: David Wertenteil \r\nSigned-off-by: John McBride \r\nSigned-off-by: Oldřich Jedlička \r\nSigned-off-by: Florent Poinsard \r\nSigned-off-by: Luiz Carvalho \r\nSigned-off-by: Marc Khouzam \r\nSigned-off-by: Taavi Väänänen \r\nSigned-off-by: Paul Holzinger \r\nSigned-off-by: Volodymyr Khoroz \r\nSigned-off-by: Nir Soffer \r\nCo-authored-by: Brian Pursley \r\nCo-authored-by: Enrico Candino \r\nCo-authored-by: Norman Dankert \r\nCo-authored-by: Unai Martinez-Corral <38422348+umarcor@users.noreply.github.com>\r\nCo-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>\r\nCo-authored-by: David Wertenteil \r\nCo-authored-by: Yash Ladha <18033231+yashLadha@users.noreply.github.com>\r\nCo-authored-by: Seonghyeon Cho \r\nCo-authored-by: Dominik Roos \r\nCo-authored-by: Shihta Kuan \r\nCo-authored-by: janhn \r\nCo-authored-by: Ggg6542 <465806+gusega@users.noreply.github.com>\r\nCo-authored-by: John McBride \r\nCo-authored-by: Gyanendra Mishra \r\nCo-authored-by: Oldřich Jedlička \r\nCo-authored-by: Oldřich Jedlička \r\nCo-authored-by: Florent Poinsard <35779988+frouioui@users.noreply.github.com>\r\nCo-authored-by: Luiz Carvalho \r\nCo-authored-by: Marc Khouzam \r\nCo-authored-by: Deleplace \r\nCo-authored-by: Tom Payne \r\nCo-authored-by: Taavi Väänänen \r\nCo-authored-by: Branch Vincent \r\nCo-authored-by: Paul Holzinger <45212748+Luap99@users.noreply.github.com>\r\nCo-authored-by: Martijn Evers <94963229+marevers@users.noreply.github.com>\r\nCo-authored-by: gocurr \r\nCo-authored-by: Jun Nishimura \r\nCo-authored-by: Nuno Adrego <55922671+nunoadrego@users.noreply.github.com>\r\nCo-authored-by: Souma <101255979+5ouma@users.noreply.github.com>\r\nCo-authored-by: Alexandru-Claudius Virtopeanu \r\nCo-authored-by: Haoming Meng <41393704+Techming@users.noreply.github.com>\r\nCo-authored-by: vkhoroz \r\nCo-authored-by: Ville Skyttä \r\nCo-authored-by: Nir Soffer \r\nCo-authored-by: Geoffrey Ragot ","shortMessageHtmlLink":"feat: update cobra (#1)"}},{"before":"703a296b3fd597a6b96e3b5c877bafd50b74cc90","after":"bfd8d9bb30ec640dd6fe14f6b76a2dbdebacfa17","ref":"refs/heads/feat/update_cobra","pushedAt":"2024-03-15T11:16:14.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"Dav-14","name":"RAGOT David","path":"/Dav-14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/35502263?s=80&v=4"},"commit":{"message":"feat: expose GetCompletions (was getCompletions)","shortMessageHtmlLink":"feat: expose GetCompletions (was getCompletions)"}},{"before":null,"after":"703a296b3fd597a6b96e3b5c877bafd50b74cc90","ref":"refs/heads/feat/update_cobra","pushedAt":"2024-03-15T11:14:14.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"Dav-14","name":"RAGOT David","path":"/Dav-14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/35502263?s=80&v=4"},"commit":{"message":"feat: expose GetCompletions (was getCompletions)","shortMessageHtmlLink":"feat: expose GetCompletions (was getCompletions)"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAEFpfSZwA","startCursor":null,"endCursor":null}},"title":"Activity · formancehq/cobra"}