diff --git a/.github/ISSUE_TEMPLATE/.github/ISSUE_TEMPLATE/contributor_guide.md b/.github/ISSUE_TEMPLATE/contributor_guide.md similarity index 100% rename from .github/ISSUE_TEMPLATE/.github/ISSUE_TEMPLATE/contributor_guide.md rename to .github/ISSUE_TEMPLATE/contributor_guide.md diff --git a/.github/ISSUE_TEMPLATE/.github/ISSUE_TEMPLATE/user_story_based_issue.md b/.github/ISSUE_TEMPLATE/user_story_based_issue.md similarity index 100% rename from .github/ISSUE_TEMPLATE/.github/ISSUE_TEMPLATE/user_story_based_issue.md rename to .github/ISSUE_TEMPLATE/user_story_based_issue.md diff --git a/.github/workflows/lint_and_test.yml b/.github/workflows/lint_and_test.yml index 6267ea2..f29d561 100644 --- a/.github/workflows/lint_and_test.yml +++ b/.github/workflows/lint_and_test.yml @@ -15,6 +15,13 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + # - name: Exit if not Pyceaas repository + # run: | + # if [ "${{ github.repository }}" != "PyCeas/Pyceas" ]; then + # echo "Not running in PyCeas repository. Exiting." + # exit 0 + # fi + - name: Set up Python uses: actions/setup-python@v5 with: @@ -24,11 +31,30 @@ jobs: run: | python -m pip install --upgrade pip pip install ruff mypy pygame-ce pytmx + + - name: Check for Python files + id: check_files + run: | + git ls-files '*.py' > files.txt + if [ ! -s files.txt ]; then + echo "No Python files found. Skipping lint and type-check." + fi - name: Run ruff + if: success() run: | - ruff check $(git-ls '*.py') + if [ -s files.txt ]; then + ruff check $(cat files.txt) + else + echo "Skipping ruff; no Python files found." + fi - name: Run mypy + if: success() run: | - mypy main.py + if [ -s files.txt ]; then + mypy $(cat files.txt) + else + echo "Skipping mypy; no Python files found." + fi + diff --git a/Preview_button.png b/Preview_button.png new file mode 100644 index 0000000..d4404f8 Binary files /dev/null and b/Preview_button.png differ diff --git a/.github/pull_request_template.md b/pull_request_template.md similarity index 89% rename from .github/pull_request_template.md rename to pull_request_template.md index 3569d66..8efa109 100644 --- a/.github/pull_request_template.md +++ b/pull_request_template.md @@ -1,6 +1,9 @@ # Pull Request Template ## 📝 Instructions +Before you add a summary to your pull request, click on the `Preview` button in GitHub to see how your selected template will appear: +![Preview button](Preview_button.png) + Please choose the appropriate template based on the nature of your changes. Use one of the following templates: - **[Code Changes Template](https://github.com/PyCeas/Pyceas/compare/main?expand=1&template=code_pr_template.md)** @@ -9,8 +12,9 @@ Please choose the appropriate template based on the nature of your changes. Use - **[Asset Changes](https://github.com/PyCeas/Pyceas/compare/main?expand=1&template=asset_pr_template.md)** - **[Audio Changes](https://github.com/PyCeas/Pyceas/compare/main?expand=1&template=audio_pr_template.md)** -> ![IMPORTANT] +> [!IMPORTANT] > When creating a pull request, make sure the base branch is set to `main`. If you are working from a different branch, you can update the target branch > in the pull request interface. +> ---