Commit 25832f9
🩹 [Patch]: Fix and align argument completers (#508)
This pull request introduces several improvements and refactors across
argument completer scripts, license and gitignore handling, and data
formatting. The main goals are to standardize completer parameter usage,
enhance context-awareness and filtering, improve data sorting and
output, and clarify the license data model.
- Fixes #486
**Key changes:**
### Argument Completer Improvements and Refactoring
* Updated all argument completers to use `$fakeBoundParameters` instead
of `$fakeBoundParameter`, ensuring consistency and enabling
context-aware completions across the module. Added filtering and context
parameters where appropriate.
[[1]](diffhunk://#diff-22b2affe76b37eaa2b3cdee057e05020af8aa4890e0966e676e4a936d828e4e4L2-R3)
[[2]](diffhunk://#diff-22b2affe76b37eaa2b3cdee057e05020af8aa4890e0966e676e4a936d828e4e4L15-R18)
[[3]](diffhunk://#diff-775e15ad0206292ebf4f5d7659e274c2384326d9b0e9821b96280186769ba4d8L2-R3)
[[4]](diffhunk://#diff-ba8339f3d5f55d7346080dc2bd24097cc8d0bc87fc027a237bfa53617224b25eL1-R26)
[[5]](diffhunk://#diff-7d92b4f19fe6156533814de81d6618281c98a1914b85a2373be2638b660f0a96L5-R37)
[[6]](diffhunk://#diff-dc5710dd4a873f6fe7a26f241fd8261acdb594962c405f48982396275d6a530fR1-R12)
[[7]](diffhunk://#diff-eb8a0b19f6f2c88ecc3a09e6544d51dc0c5d8c61ad4f8fe40d544fc182c0ac91R1-R12)
[[8]](diffhunk://#diff-792b150421507ebd45a85f5eedf88b6fc3ead29405ceff31779746e5cd5bf7c7R1-R39)
* Moved and refactored several completers (for `Get-GitHubLicense`,
`Get-GitHubGitignore`, and `Connect-GitHubApp`) into their own dedicated
`completers.ps1` files, and removed the old implementations.
[[1]](diffhunk://#diff-de6b8171283593a8a3424849e06ab22a6d6ead1c9a677db2f91ffa2225759363L87-L94)
[[2]](diffhunk://#diff-349ba6d13800f374dc911b94db55e01a2e50be26859901f1eccf6a94d85ee05cL70-L77)
[[3]](diffhunk://#diff-2fcb088cf090e075faa3b356b6d08d341de9167e4e69d5270f34f7faf46e6cd7L1-L27)
### License Model and Formatting Updates
* Changed the `GitHubLicense` class to clarify property names: `Key` is
now `Name`, and `Name` is now `DisplayName`, with corresponding updates
to the constructor and format file.
[[1]](diffhunk://#diff-98f2ef3a26cb403b39286027e24110885695960c6c8b26853bd2af0c62e9f15eL26-R32)
[[2]](diffhunk://#diff-98f2ef3a26cb403b39286027e24110885695960c6c8b26853bd2af0c62e9f15eL81-R82)
[[3]](diffhunk://#diff-f3cb0ef91f12f89dc4c0b19bb042e6e2c4a71bb4040b46a853e4c71916c43e98L11-L32)
[[4]](diffhunk://#diff-f3cb0ef91f12f89dc4c0b19bb042e6e2c4a71bb4040b46a853e4c71916c43e98L44-L85)
* Updated the license format table to display the new property names and
removed less relevant columns for a cleaner output.
[[1]](diffhunk://#diff-f3cb0ef91f12f89dc4c0b19bb042e6e2c4a71bb4040b46a853e4c71916c43e98L11-L32)
[[2]](diffhunk://#diff-f3cb0ef91f12f89dc4c0b19bb042e6e2c4a71bb4040b46a853e4c71916c43e98L44-L85)
### Context and Filtering Enhancements
* Improved context handling and filtering for completers, ensuring that
completions are accurate with respect to the current context and user
input.
[[1]](diffhunk://#diff-22b2affe76b37eaa2b3cdee057e05020af8aa4890e0966e676e4a936d828e4e4L15-R18)
[[2]](diffhunk://#diff-7d92b4f19fe6156533814de81d6618281c98a1914b85a2373be2638b660f0a96L5-R37)
[[3]](diffhunk://#diff-ba8339f3d5f55d7346080dc2bd24097cc8d0bc87fc027a237bfa53617224b25eL1-R26)
[[4]](diffhunk://#diff-dc5710dd4a873f6fe7a26f241fd8261acdb594962c405f48982396275d6a530fR1-R12)
[[5]](diffhunk://#diff-eb8a0b19f6f2c88ecc3a09e6544d51dc0c5d8c61ad4f8fe40d544fc182c0ac91R1-R12)
* Added support for `App` authentication to `Get-GitHubLicense`, and
ensured that if the context is an App, it falls back to anonymous.
### Data Sorting and Output Consistency
* Ensured that results from `Get-GitHubAppInstallation` are sorted by
`Type` and `Target` for more predictable output.
[[1]](diffhunk://#diff-9ca965372ef6314e8f8759ce87dedff3c8a0d216fe06fda41e0fb38b89722dfeL60-R60)
[[2]](diffhunk://#diff-9ca965372ef6314e8f8759ce87dedff3c8a0d216fe06fda41e0fb38b89722dfeR81)
### Miscellaneous
* Commented out an unused `Accept` header in the gitignore API call,
likely to prevent issues with response formatting.
These changes collectively improve the maintainability, usability, and
consistency of the module's command-line experience.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Co-authored-by: Marius Storhaug <marstor@hotmail.com>1 parent 8972167 commit 25832f9
File tree
23 files changed
+203
-200
lines changed- src
- classes/public
- Repositories
- formats
- functions
- private/Gitignore
- public
- Apps/GitHub App Installations
- Auth
- Context
- Config
- Environments
- Gitignore
- License
- Organization
- Permission
- Repositories
- Permissions
- Secrets
- Teams
- Variables
- Workflows
- tests
23 files changed
+203
-200
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
81 | 83 | | |
82 | | - | |
83 | | - | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | 11 | | |
15 | 12 | | |
16 | 13 | | |
17 | 14 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 15 | + | |
25 | 16 | | |
26 | 17 | | |
27 | 18 | | |
28 | 19 | | |
29 | 20 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | 21 | | |
34 | 22 | | |
35 | 23 | | |
| |||
41 | 29 | | |
42 | 30 | | |
43 | 31 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 32 | + | |
51 | 33 | | |
52 | 34 | | |
53 | 35 | | |
54 | 36 | | |
55 | 37 | | |
56 | 38 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | 39 | | |
87 | 40 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
| 2 | + | |
| 3 | + | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
3 | 2 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
| 4 | + | |
7 | 5 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 19 | + | |
| 20 | + | |
23 | 21 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
0 commit comments