Skip to content

Commit

Permalink
Create Feature Request form/template (#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
rcalixte authored Oct 26, 2023
1 parent 77ee3ec commit 282ab15
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 2 deletions.
60 changes: 60 additions & 0 deletions .github/ISSUE_TEMPLATE/02_feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# DO NOT EDIT THIS FILE MANUALLY.
# Execute the script called feature_request_creator.py to generate it.

---
body:
- attributes:
value: Thanks for taking the time to fill out this feature request!
type: markdown
- attributes:
default: 0
label: Extension name and maintainer
options:
- back-to-monitor@nathan818fr @nathan818fr
- [email protected]
- cinnamon-dynamic-wallpaper@TobiZog @TobiZog
- cinnamon-maximus@fmete
- [email protected] @hermes83
- desktop-icons-per-workspace@cardsurf @cardsurf
- desktop-scroller@ccadeptic23
- DesktopCube@yare
- extra-panel-settings@gr3q @gr3q
- Flipper@connerdev
- gTile@shuairan
- horizontal-osd@berk-karaal @berk-karaal
- mnemonic-5-4-window-menu@mtwebster @mtwebster
- mouse-shake-zoom@rcalixte @rcalixte
- [email protected]
- rnbdsh@negateWindow @rnbdsh
- SanitizeXsessionErrors@claudiux @claudiux
- ShadowParameters@mikhail-ekzi @mikhail-ekzi
- slider@mohammad-sn @mohammad-sn
- smart-panel@mohammad-sn @mohammad-sn
- transparent-panels-reloaded@marcelovbcfilho @marcelovbcfilho
- transparent-panels@germanfr @germanfr
- user-shadows@nathan818fr @nathan818fr
- watermark@germanfr @germanfr
- [email protected]
- workspace-scroller@ori
id: extension
type: dropdown
validations:
required: true
- attributes:
description: Add as many details as possible!
label: What would you like to see?
placeholder: Tell the author what you want to see!
id: feature-request
type: textarea
validations:
required: true
- attributes:
value: '*By submitting this feature request, you agree to behave respectfully
and in a mature manner. If in doubt, refer to the [Golden Rule](https://en.wikipedia.org/wiki/Golden_Rule)
and [Github''s Community Guidelines](https://docs.github.com/en/site-policy/github-terms/github-community-guidelines).*'
type: markdown
description: "If you have a feature request \U0001F4A1"
labels:
- feature request
name: "\U0001F680 Extension Feature Request"
title: Extension Feature Request
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
blank_issues_enabled: false
contact_links:
- name: 🚀 Feature Request
- name: 💬 Linux Mint Discussions
url: https://github.com/orgs/linuxmint/discussions
about: If you have a feature request 💡
about: Engage with other members of the community. 👋
- name: ❓ Linux Mint Forums
url: https://forums.linuxmint.com/
about: Please ask and answer questions here. 🏥
74 changes: 74 additions & 0 deletions .github/feature_request_creator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/usr/bin/python3
'''
Generate 02_feature_request.yml based on repository files
'''

import os
import json
import yaml

dirs_blacklist = ['.git', '.github']

repo_folder = os.path.realpath(os.path.abspath(os.path.join(
os.path.normpath(os.path.join(os.getcwd(), *(['..'] * 1))))))

HEADER = '''# DO NOT EDIT THIS FILE MANUALLY.
# Execute the script called feature_request_creator.py to generate it.
---
'''

FEATURE_RQ = {'name': '🚀 Extension Feature Request',
'description': "If you have a feature request 💡",
'title': 'Extension Feature Request',
'labels': ['feature request'],
'body': [{'type': 'markdown',
'attributes': {'value': 'Thanks for taking the time to fill out this feature request!'}},
{'type': 'dropdown', 'id': 'extension',
'attributes': {'default': 0,
'label': 'Extension name and maintainer',
'options': []},
'validations': {'required': True}},
{'type': 'textarea', 'id': 'feature-request',
'attributes': {'description': 'Add as many details as possible!',
'label': 'What would you like to see?',
'placeholder': 'Tell the author what you want to see!'},
'validations': {'required': True}},
{'type': 'markdown',
'attributes': {'value': "*By submitting this feature request, you agree to behave respectfully and in a mature manner. If in doubt, refer to the [Golden Rule](https://en.wikipedia.org/wiki/Golden_Rule) and [Github's Community Guidelines](https://docs.github.com/en/site-policy/github-terms/github-community-guidelines).*"}}]}


def main():
"""
List the repository directories and retrieve author information.
"""
xlets_and_authors = []

try:
for name in os.listdir(repo_folder):
if name in dirs_blacklist:
continue

info_file_path = os.path.join(repo_folder, name, 'info.json')

if os.path.isfile(info_file_path):
with open(info_file_path, 'r', encoding='utf-8') as info:
file_data = json.load(info)

author_value = file_data.get('author', 'none')
author = '' if author_value == 'none' else f' @{author_value}'

xlets_and_authors.append(f'{name}{author}')
finally:
dropdown_list = sorted(sorted(xlets_and_authors), key=str.casefold)
with open(os.path.join(repo_folder, '.github', 'ISSUE_TEMPLATE',
'02_feature_request.yml'), 'w',
encoding='utf-8') as feature_request_yaml:
FEATURE_RQ['body'][1]['attributes']['options'] = dropdown_list

feature_request_yaml.write(HEADER)
yaml.dump(FEATURE_RQ, feature_request_yaml)


if __name__ == '__main__':
main()

0 comments on commit 282ab15

Please sign in to comment.