Skip to content

Commit

Permalink
Merge branch 'main' into refactoring-code-02
Browse files Browse the repository at this point in the history
  • Loading branch information
og-mrk committed Aug 26, 2024
2 parents e0bc12f + cfb9edb commit 49639ec
Show file tree
Hide file tree
Showing 207 changed files with 18,859 additions and 21,849 deletions.
117 changes: 117 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# How to Contribute?

## Testing

* Test the latest changes to WinUtil by running the pre-release and reporting issues you are encountering to help us continually improve WinUtil!

#### **Run the latest pre-release**
```ps1
irm christitus.com/windev | iex
```

!!! bug "Keep in mind"

This is a pre-release and should be treated as such. It exists for developers to test the utility and report or fix bugs before they get added to the stable release. Don't use it in production!

## Issues

* If you encounter any challenges or problems with the script, I kindly request that you submit them via the "Issues" tab on the GitHub repository. By filling out the provided template, you can provide specific details about the issue, allowing me (and others in the community) to promptly address any bugs or consider feature requests.

## Contribute Code

* Pull requests are now handled directly on the **MAIN branch**. This was done since we can now select specific releases to launch via releases in GitHub.

* If you're doing code changes, then you can submit a PR to `main` branch, but I am very selective about these.

!!! warning "Important"

Do not use a code formatter, make massive amounts of line changes, or make multiple feature changes. EACH FEATURE CHANGE SHOULD BE IT'S OWN PULL REQUEST!

* When creating pull requests, it is essential to thoroughly document all changes made. This includes, but is not limited to, documenting any additions made to the `tweaks` section and corresponding `undo tweak`, so users are able to remove the newly added tweaks if necessary, and comprehensive documentation is required for all code changes. Document your changes and briefly explain why you made your changes in your Pull Request Description. Failure to adhere to this format may result in the denial of the pull request. Additionally, any code lacking sufficient documentation may also be denied.

* By following these guidelines, we can maintain a high standard of quality and ensure that the codebase remains organized and well-documented.

!!! note

When creating a function, please include "WPF" or "WinUtil" in the file name so it can be loaded into the runspace.

## Walk through

* This is a guide for beginners. If you are still having issues, look at the following official GitHub documentation:
* [Commit through WEB](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/about-commits)
* [Commit through GitHub Desktop](https://docs.github.com/en/desktop/making-changes-in-a-branch/committing-and-reviewing-changes-to-your-project-in-github-desktop#about-commits)
* [Create a Pull Request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)


### Overview

``` mermaid
%%{init: {"flowchart": {"curve": "cardinal"}} }%%
graph TD
  A[Fork Project] --> B[Clone Repository];
  B --> C[Create New Branch];
  C --> D[Make Changes];
  D --> G[Test Changes];
  G --> H{Tests Passed?};
  H -->|Yes| E[Commit Changes];
  H -->|No| J[Fix Issues];
  J --> G;
  E --> F[Push Branch];
  F --> K[Create Pull Request];
  K --> L[Fill out PR template];
classDef default stroke:#333,stroke-width:4px,font-size:12pt;
```
!!! info

This is a diagram to guide you through the process. It may vary depending on the type of change you're making.

### Fork the Repo
* Fork the WinUtil Repository [here](https://github.com/ChrisTitusTech/winutil) to create a copy that will be available in your repository list.

![Fork Image](assets/Fork-Button-Dark.png#only-dark)

![Fork Image](assets/Fork-Button-Light.png#only-light)

### Clone the Fork
!!! tip

While you can make your changes directly through the Web, we recommend cloning the repo to your device using the application GitHub Desktop (available in WinUtil) to test your fork easily.

* Install GitHub Desktop if it is not already installed.
* Log in using the same GitHub account you used to fork WinUtil.
* Choose the fork under "Your Repositories" and press "clone {repo name}"
* Create a new branch and name it something relatable to your changes.

* Now you can modify WinUtil to your liking using your preferred text editor.


### Testing your changes

* To test to see if your changes work as intended run following commands in a powershell teminal as admin:

* Change the directory where you are running the commands to the forked project.
* `cd {path to the folder with the compile.ps1}`
* Run the following command to compile and run WinUtil:
* `.\Compile.ps1 -run`

![Compile](assets/Compile.png)

* After seeing that your changes work properly, feel free to commit the changes to the repository and make a PR. For help on that, follow the documentation below.

### Committing the changes
* Before committing your changes, please discard changes made to the `winutil.ps1` file, like the following:

![Push Commit Image](assets/Discard-GHD.png)

* Now, commit your changes once you are happy with the result.

![Commit Image](assets/Commit-GHD.png)

* Push the changes to upload them to your fork on github.com.

![Push Commit Image](assets/Push-Commit.png)

### Making a PR
* To make a PR on your repo under a new branch linking to the main branch, a button will show and say Preview and Create pull request. Click that button and fill in all the information that is provided on the template. Once all the information is filled in correctly, check your PR to make sure there is not a WinUtil.ps1 file attached to the PR. Once everything is good, make the PR and wait for Chris (the maintainer) to accept or deny your PR. Once it is accepted by Chris, you will be able to see your changes in the "/windev" build.
* If you do not see your feature in the main "/win" build, that is fine. All new changes go into the /windev build to make sure everything is working OK before going fully public.
* Congratulations! You just submitted your first PR. Thank you so much for contributing to WinUtil.
File renamed without changes.
5 changes: 5 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Security Policy

If you find a security issue please make post it in the issues tab. If you think it should be private you can email me at [email protected].

For immediate response check out our discord server @ [![](https://dcbadge.limes.pink/api/server/https://discord.gg/RUbZUZyByQ?theme=default-inverted&style=for-the-badge)](https://discord.gg/RUbZUZyByQ)
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ updates:
ignore:
- dependency-name: "actions/stale"
versions: '>= 9'
- dependency-name: "actions/setup-python"
versions: '> 4'
35 changes: 24 additions & 11 deletions mkdocs.yml → .github/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
site_name: Chris Titus WinUtil Official Documentation
site_name: WinUtil Documentation
docs_dir: '../docs'
repo_url: https://github.com/ChrisTitusTech/winutil

nav:
- Introduction: 'index.md'
- User Guide: 'userguide.md'
- Contribute: 'contribute.md'
- Changelog: 'changelog.md'
- Known Issues: 'KnownIssues.md'
- Contributing Guide: 'contribute.md'
- Documentation:
- Dev Docs: 'devdocs.md'
- Known Issues: 'KnownIssues.md'
- FAQ: 'faq.md'

theme:
name: material
custom_dir: 'overrides'
custom_dir: '../overrides'
features:
- navigation.tabs
- navigation.sections
Expand All @@ -34,21 +36,20 @@ theme:

# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default


scheme: default
accent: blue
toggle:
icon: material/brightness-7
name: Switch to dark mode

# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: black
accent: blue
toggle:
icon: material/toggle-switch
icon: material/weather-night
name: Switch to light mode
primary: teal
accent: lime
markdown_extensions:
- admonition
- pymdownx.details
Expand All @@ -73,3 +74,15 @@ markdown_extensions:
- def_list
- pymdownx.tasklist:
custom_checkbox: true
- toc:
permalink: true

plugins:
- search
- awesome-pages
- git-revision-date-localized
- minify:
minify_html: true
htmlmin_opts:
remove_comments: true
cache_safe: true
51 changes: 51 additions & 0 deletions .github/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Babel==2.15.0
bracex==2.5
cairocffi==1.7.1
CairoSVG==2.7.1
certifi==2024.7.4
cffi==1.17.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
csscompressor==0.9.5
cssselect2==0.7.0
defusedxml==0.7.1
ghp-import==2.1.0
gitdb==4.0.11
GitPython==3.1.43
htmlmin2==0.1.13
idna==3.7
Jinja2==3.1.4
jsmin==3.0.1
Markdown==3.6
MarkupSafe==2.1.5
mergedeep==1.3.4
mkdocs==1.6.0
mkdocs-awesome-pages-plugin==2.9.3
mkdocs-get-deps==0.2.0
mkdocs-git-revision-date-localized-plugin==1.2.6
mkdocs-material==9.5.31
mkdocs-material-extensions==1.3.1
mkdocs-minify-plugin==0.8.0
natsort==8.4.0
packaging==24.1
paginate==0.5.6
pathspec==0.12.1
pillow==10.4.0
platformdirs==4.2.2
pycparser==2.22
Pygments==2.18.0
pymdown-extensions==10.9
python-dateutil==2.9.0.post0
pytz==2024.1
PyYAML==6.0.2
pyyaml_env_tag==0.1
regex==2024.7.24
requests==2.32.3
six==1.16.0
smmap==5.0.1
tinycss2==1.3.0
urllib3==2.2.2
watchdog==4.0.1
wcmatch==9.0
webencodings==0.5.1
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Check if PR was merged
if: github.event.pull_request.merged == true
run: echo "PR was merged"

- name: Extract Discussion Number & Close If any Were Found
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -23,21 +23,26 @@ jobs:
run: |
pr_body="${{ github.event.pull_request.body }}"
discussion_ids=$(echo "$pr_body" | grep -oP '(?i)(resolve|fix|close)[s|d]? #\K[0-9]+')
if [ -z "$discussion_ids" ]; then
echo "No discussion IDs found."
exit 0
fi
for discussion_id in $discussion_ids; do
echo "Closing discussion #$discussion_id"
response=$(curl -s -o /dev/null -w "%{http_code}" -X PATCH -H "Authorization: token $GITHUB_TOKEN" \
echo "Attempting to close discussion #$discussion_id"
response=$(curl -s -X PATCH -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"state": "closed"}' \
"https://api.github.com/repos/${{ github.repository }}/discussions/$discussion_id")
if [ "$response" -ne 200 ]; then
echo "Failed to close discussion #$discussion_id. HTTP status code: $response"
exit 1
if echo "$response" | jq -e '.id' > /dev/null; then
echo "Successfully closed discussion #$discussion_id"
else
error_message=$(echo "$response" | jq -r '.message // "Unknown error"')
echo "Warning: Failed to close discussion #$discussion_id. Error: $error_message"
echo "Full response: $response"
fi
done
shell: bash
shell: bash
continue-on-error: true
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
ISSUE_NUMBER: ${{ github.event.issue.number }}
run: |
echo Closing the issue...
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }}
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }}
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
name: Compile
name: Compile & Check

on:
push:
branches:
- main
- test*
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch: # Manual trigger added
workflow_call: # Allow other Actions to call this workflow

jobs:
build-runspace:
Compile-and-Check:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Compile project
- name: Checkout Sources
uses: actions/checkout@v4

- name: Compile and Syntaxcheck winutil.ps1
shell: pwsh
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force; ./Compile.ps1
continue-on-error: false # Directly fail the job on error, removing the need for a separate check
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Compile Winutil
if: success()
Loading

0 comments on commit 49639ec

Please sign in to comment.