Commit 34d0ae1
authored
🚀 [Feature]: Add
## Description
This pull request includes several changes across multiple files,
primarily focusing on adding new functionalities for AST (Abstract
Syntax Tree) operations, updating linting configurations, and minor
updates to documentation and metadata. The most important changes
include adding new functions for AST operations, updating linting
configurations, and modifying documentation.
### New AST Functions:
* Added `Get-AstCommand` function to retrieve command AST elements from
a PowerShell script or AST object
(`src/functions/public/Core/Get-ASTCommand.ps1`).
* Added `Get-AstFunction` function to retrieve function definitions from
a PowerShell script or AST
(`src/functions/public/Core/Get-ASTFunction.ps1`).
* Added `Get-AstScript` function to parse a PowerShell script or script
file and return its AST (`src/functions/public/Core/Get-ASTScript.ps1`).
* Added `Get-ASTFunctionAlias` function to retrieve function aliases
from a PowerShell script or file
(`src/functions/public/Functions/Get-ASTFunctionAlias.ps1`).
### Linting Configuration Updates:
* Added a new `.jscpd.json` configuration file for JavaScript code
duplication detection (`.github/linters/.jscpd.json`).
* Updated `.powershell-psscriptanalyzer.psd1` to include specific
PowerShell Script Analyzer rules and settings
(`.github/linters/.powershell-psscriptanalyzer.psd1`).
* Modified `Linter.yml` to disable JSON Prettier validation
(`.github/workflows/Linter.yml`).
### Documentation and Metadata Updates:
* Updated the `LICENSE` file to reflect the year 2025 (`LICENSE`).
* Updated the example function name in the `README.md` to
`Get-ASTFunctionName` (`README.md`).
### Removed Deprecated Functions:
* Removed `Get-FunctionAST` and `Get-ScriptAST` functions as they have
been replaced by new AST functions
(`src/functions/public/Core/Get-FunctionAST.ps1`,
`src/functions/public/Core/Get-ScriptAST.ps1`).
[[1]](diffhunk://#diff-ebd4e1ad30387639d36d84e6a48c5b48cb76c42514fa21253a16d440b7cb4021L1-L46)
[[2]](diffhunk://#diff-dfd1b919296a66069c792bbb32868f85ab37b6952f7646b18ba660edfb779a28L1-L74)
### Example Removal:
* Removed the general example script (`examples/General.ps1`).
## Type of change
<!-- Use the check-boxes [x] on the options that are relevant. -->
- [ ] 📖 [Docs]
- [ ] 🪲 [Fix]
- [ ] 🩹 [Patch]
- [ ] Get-ASTCommand to get commands ++ (#15)1 parent 0ee8bd6 commit 34d0ae1
26 files changed
Lines changed: 1547 additions & 499 deletions
File tree
- .github
- linters
- workflows
- examples
- src/functions/public
- Core
- Functions
- Lines
- Scripts
- tests
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 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 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
10 | 52 | | |
11 | | - | |
| 53 | + | |
| 54 | + | |
12 | 55 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | 56 | | |
0 commit comments