Skip to content

Commit 63f7fbf

Browse files
committed
Merge branch 'main' into 464-codeconduct
2 parents b173def + 33f92a3 commit 63f7fbf

14 files changed

Lines changed: 56 additions & 18 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Added
66

77
* Make Code of Conduct optional [#464](https://github.com/NLeSC/python-template/pull/530)
8+
* Make SonarCloud optional [#515](https://github.com/NLeSC/python-template/pull/515)
89
* Make citation optional [#471](https://github.com/NLeSC/python-template/pull/471)
910
* Make online documentation optional [#476](https://github.com/NLeSC/python-template/pull/476)
1011
* Added Python 3.12 support [#356](https://github.com/NLeSC/python-template/issues/356)

copier.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ version:
2323
github_organization:
2424
type: str
2525
default: "<my-github-organization>"
26+
help: Enter the name of your GitHub username or organization
2627
full_name:
2728
type: str
2829
default: Jane Smith
@@ -114,6 +115,12 @@ AddCodeConduct:
114115
help: Add code of conduct?
115116

116117

118+
AddSonarCloud:
119+
when: "{{ template_profile == 'ask' }}"
120+
type: bool
121+
default: "{{ template_profile != 'minimum' }}"
122+
help: Add SonarCloud (code analysis service) integration?
123+
117124
# internal fields
118125
_subdirectory: template
119126

profiles.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
- project_setup.md
2323

2424
- code quality:
25-
- sonarcloud
25+
- sonarcloud #515
2626
- ruff and lint workflow
2727
- github action to build (exist) #451
2828
- pre-commit

template/.github/workflows/next_steps.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v4
11-
- name: Create Sonarcloud integration issue
12-
uses: JasonEtco/create-an-issue@v2
13-
env:
14-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15-
with:
16-
filename: .github/next_steps/01_sonarcloud_integration.md
17-
id: sonarcloud
1811
- name: Create Zenodo integration issue
1912
uses: JasonEtco/create-an-issue@v2
2013
env:
@@ -32,7 +25,6 @@ jobs:
3225
- name: List created issues
3326
run: |
3427
echo 'Created issues that must be completed to have fully working Python package:
35-
* Sonarcloud integration ${{ steps.sonarcloud.outputs.url }}
3628
* Zenodo integration ${{ steps.zenodo.outputs.url }}
3729
* Linting fixes ${{ steps.linting.outputs.url }}'
3830
- name: Cleanup files needed to create next steps issues

template/.github/workflows/{% if AddCitation %}next_steps_citation.yml{% endif %}

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
env:
1414
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1515
with:
16-
filename: .github/next_steps/02_citation.md
16+
filename: .github/workflows/next_steps_citation_issue.md
1717
id: citation
1818
- name: List created issues
1919
run: |
@@ -23,7 +23,8 @@ jobs:
2323
run: |
2424
git config --global user.name 'NLeSC Python template'
2525
git config --global user.email 'nlesc-python-template@users.noreply.github.com'
26+
git pull # other next step workflows may push changes before
2627
git rm .github/workflows/next_steps_citation.yml
27-
git rm -r .github/next_steps
28-
git commit -am "Cleanup automated next steps issue generator"
28+
git rm .github/workflows/next_steps_citation_issue.md
29+
git commit -am "Cleanup automated next steps issue generator for citation"
2930
git push

template/.github/next_steps/{% if AddCitation %}02_citation.md{% endif %}.jinja renamed to template/.github/workflows/{% if AddCitation %}next_steps_citation_issue.md{% endif %}.jinja

File renamed without changes.

template/.github/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation.yml{% endif %}

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v4
11-
- name: Create readthedocs issue
11+
- name: Create online documentation issue
1212
uses: JasonEtco/create-an-issue@v2
1313
env:
1414
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1515
with:
16-
filename: .github/next_steps/03_readthedocs.md
16+
filename: .github/workflows/next_steps_online_documentation_issue.md
1717
id: readthedocs
1818
- name: List created issues
1919
run: |
@@ -23,7 +23,8 @@ jobs:
2323
run: |
2424
git config --global user.name 'NLeSC Python template'
2525
git config --global user.email 'nlesc-python-template@users.noreply.github.com'
26+
git pull # other next step workflows may push changes before
2627
git rm .github/workflows/next_steps_online_documentation.yml
27-
git rm -r .github/next_steps
28-
git commit -am "Cleanup automated next steps issue generator"
28+
git rm .github/workflows/next_steps_online_documentation_issue.md
29+
git commit -am "Cleanup automated next steps issue generator for online documentation"
2930
git push

template/.github/next_steps/{% if AddOnlineDocumentation %}03_readthedocs.md{% endif %}.jinja renamed to template/.github/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation_issue.md{% endif %}.jinja

File renamed without changes.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
on: [push]
2+
permissions:
3+
contents: write
4+
issues: write
5+
name: Create an issue for Sonarcloud
6+
jobs:
7+
next_steps:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Create Sonarcloud issue
12+
uses: JasonEtco/create-an-issue@v2
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
with:
16+
filename: .github/workflows/next_steps_sonarcloud_issue.md
17+
id: sonarcloud
18+
- name: List created issues
19+
run: |
20+
echo 'Created issues that must be completed to have fully working Python package:
21+
* Sonarcloud integration ${{ steps.sonarcloud.outputs.url }}'
22+
- name: Cleanup files needed to create next steps issues
23+
run: |
24+
git config --global user.name 'NLeSC Python template'
25+
git config --global user.email 'nlesc-python-template@users.noreply.github.com'
26+
git pull # other next step workflows may push changes before
27+
git rm .github/workflows/next_steps_sonarcloud.yml
28+
git rm .github/workflows/next_steps_sonarcloud_issue.md
29+
git commit -am "Cleanup automated next steps issue generator for sonarcloud"
30+
git push

template/.github/next_steps/01_sonarcloud_integration.md.jinja renamed to template/.github/workflows/{% if AddSonarCloud %}next_steps_sonarcloud_issue.md{% endif %}.jinja

File renamed without changes.

0 commit comments

Comments
 (0)