From ea6c67a96ebec9f67327e804696a168c4baee73d Mon Sep 17 00:00:00 2001 From: rulasg Date: Thu, 4 Sep 2025 12:46:53 +0200 Subject: [PATCH 1/2] feat: add Search-Repo function to search repositories by string --- public/repo-search.ps1 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/public/repo-search.ps1 b/public/repo-search.ps1 index 7a22bc5..80b8146 100644 --- a/public/repo-search.ps1 +++ b/public/repo-search.ps1 @@ -46,3 +46,23 @@ function Find-RepoByName{ return $ret } Export-ModuleMember -Function Find-RepoByName + +function Search-Repo{ + [CmdletBinding()] + param( + [Parameter(Mandatory,Position=0)][string]$SearchString + ) + + $attributes = 'name,url' + + $command = 'gh search repos {searchstring} --json {attributes}' + + $command = $command -replace "{searchstring}", "$($SearchString)" + $command = $command -replace "{attributes}", "$($attributes)" + + $command | Write-Verbose + + $ret = Invoke-GhExpression -Command $command + + return $ret +} Export-ModuleMember -Function Search-Repo From 24855f32607b13c055695b4177cfe8eb88a0d8c3 Mon Sep 17 00:00:00 2001 From: rulasg Date: Thu, 4 Sep 2025 12:53:28 +0200 Subject: [PATCH 2/2] docs(github): add Copilot instructions and commit/PR guidelines --- .../copilot-commit-message-instructions.md | 34 ++++++++++++++ .github/copilot-instructions.md | 44 +++++++++++++++++++ ...t-pull-request-description-instructions.md | 44 +++++++++++++++++++ 3 files changed, 122 insertions(+) create mode 100644 .github/copilot-commit-message-instructions.md create mode 100644 .github/copilot-instructions.md create mode 100644 .github/copilot-pull-request-description-instructions.md diff --git a/.github/copilot-commit-message-instructions.md b/.github/copilot-commit-message-instructions.md new file mode 100644 index 0000000..2297468 --- /dev/null +++ b/.github/copilot-commit-message-instructions.md @@ -0,0 +1,34 @@ +# Semantic Commit Messages + +See how a minor change to your commit message style can make you a better programmer. + +Format: `(): ` + +`` is optional + +## Example + +``` +feat: add hat wobble +^--^ ^------------^ +| | +| +-> Summary in present tense. +| ++-------> Type: chore, docs, feat, fix, refactor, style, or test. +``` + +More Examples: + +- `feat`: (new feature for the user, not a new feature for build script) +- `fix`: (bug fix for the user, not a fix to a build script) +- `docs`: (changes to the documentation) +- `style`: (formatting, missing semi colons, etc; no production code change) +- `refactor`: (refactoring production code, eg. renaming a variable) +- `test`: (adding missing tests, refactoring tests; no production code change) +- `chore`: (updating grunt tasks etc; no production code change) + +References: + +- https://www.conventionalcommits.org/ +- https://seesparkbox.com/foundry/semantic_commit_messages +- http://karma-runner.github.io/1.0/dev/git-commit-msg.html diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..aea90af --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,44 @@ +# Copilot Instructions + +## Powershell Modules Code Instructions + +### PowerShell Functions Instructions + +Every powershell function will contain the `CmdletBinding` attribute and the `parm`iven if there are no parameters. +If the function is on the public folder of the module, we will add the Èxport-ModuleFunction` statement in the same line as the closing `}` of the function + +Sample of function will be: + +```powershell + +function Get-UserName{ + [CmdletBinding()] + param() + + #Logic of the function +} Export-ModuleFunction -FunctionName 'Get-UserName' +``` + +### PowerShell Test Instructions + +Every public function on the Test module will have the following format + +- Name will start with `Test_` will follow the name of the function that we are testing with no '-'. It will follow the intention of the test splited with a '_' +- Every time we create a new function with no body we will add the `Assert-NotImplemented` statement at the end +- We will add the 3 sections as with comments `Arrange`, `Act` and `Assert` to make the test more readable. +- Sample of a test function to test `Get-UserName` function will be `Test_GetUserName_UserNotFound` + +Full sample will be as follows + +```powershell +function Test_GetUserName_UserNotFound{ + + # Arrange + + # Act + + # Assert + + Assert-NotImplemented +} +``` diff --git a/.github/copilot-pull-request-description-instructions.md b/.github/copilot-pull-request-description-instructions.md new file mode 100644 index 0000000..31a8730 --- /dev/null +++ b/.github/copilot-pull-request-description-instructions.md @@ -0,0 +1,44 @@ +# Pull Request Code Instructions + +## PR TITLE + +Follow this guidelines to construct the title of your pull request. + +Format: `(): ` + +`` is optional + +## Example + +``` +feat: add hat wobble +^--^ ^------------^ +| | +| +-> Summary in present tense. +| ++-------> Type: chore, docs, feat, fix, refactor, style, or test. +``` + +More Examples: + +- `feat`: (new feature for the user, not a new feature for build script) +- `fix`: (bug fix for the user, not a fix to a build script) +- `docs`: (changes to the documentation) +- `style`: (formatting, missing semi colons, etc; no production code change) +- `refactor`: (refactoring production code, eg. renaming a variable) +- `test`: (adding missing tests, refactoring tests; no production code change) +- `chore`: (updating grunt tasks etc; no production code change) + +References: + +- https://www.conventionalcommits.org/ +- https://seesparkbox.com/foundry/semantic_commit_messages +- http://karma-runner.github.io/1.0/dev/git-commit-msg.html + +## Pull Reques description + +- Add a summery of the intention of the PR. Use the title and the messages of the commits to create a summary. +- Add a list with all the commit messages in the PR. + + +