From 347f0df5fd32df4cf42a1215e3eb49f726161e3c Mon Sep 17 00:00:00 2001 From: Vadim Nifadev <36514612+nifadyev@users.noreply.github.com> Date: Tue, 19 Nov 2024 09:23:44 +0300 Subject: [PATCH] #269: Update CONTRIBUTING guidelines, add PR and issue templates - Add issue templates for bugs, translations and new snippets - Add PR templates for general purpose, new snippets and translations --- .github/ISSUE_TEMPLATE/bug.md | 25 ++++++++++ .github/ISSUE_TEMPLATE/new_snippet.md | 22 +++++++++ .github/ISSUE_TEMPLATE/translation.md | 13 ++++++ .github/PULL_REQUEST_TEMPLATE/new_snippet.md | 15 ++++++ .../pull_request_template.md | 13 ++++++ .github/PULL_REQUEST_TEMPLATE/translation.md | 13 ++++++ CONTRIBUTING.md | 46 ++++++++++--------- 7 files changed, 125 insertions(+), 22 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug.md create mode 100644 .github/ISSUE_TEMPLATE/new_snippet.md create mode 100644 .github/ISSUE_TEMPLATE/translation.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/new_snippet.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/translation.md diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000..0e7241e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,25 @@ +--- +name: Bug report +about: Bug template +title: 'Fix ...' +labels: 'bug' + +--- + + +## What's wrong + + + +## How it should work? + + + +## Checklist before calling for maintainers + +* [ ] Have you checked to ensure there aren't other open [Issues](../../../issues) for the same problem? + diff --git a/.github/ISSUE_TEMPLATE/new_snippet.md b/.github/ISSUE_TEMPLATE/new_snippet.md new file mode 100644 index 0000000..75810da --- /dev/null +++ b/.github/ISSUE_TEMPLATE/new_snippet.md @@ -0,0 +1,22 @@ +--- +name: New snippet +about: New snippet template +title: 'New snippet: ...' +labels: 'new snippets' +--- + + +## Description + +## Snippet preview + +## Checklist before calling for maintainers + +* [ ] Have you checked to ensure there aren't other open [Issues](../../../issues) for the same update/change? +* [ ] Have you checked that this snippet is not similar to any of the existing snippets? +* [ ] Have you added an `Explanation` section? It shall include the reasons of changes and why you'd like us to include them + diff --git a/.github/ISSUE_TEMPLATE/translation.md b/.github/ISSUE_TEMPLATE/translation.md new file mode 100644 index 0000000..788bc4c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/translation.md @@ -0,0 +1,13 @@ +--- +name: Translation +about: New translation template +title: 'Tranlate to ...' +labels: 'translations' + +--- + + +## Checklist before calling for maintainers + +* [ ] Have you checked to ensure there aren't other open [Issues](../../../issues) for the same tranlation? +* [ ] Do you wish to make a translation by yourself? diff --git a/.github/PULL_REQUEST_TEMPLATE/new_snippet.md b/.github/PULL_REQUEST_TEMPLATE/new_snippet.md new file mode 100644 index 0000000..5d10e7f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/new_snippet.md @@ -0,0 +1,15 @@ +## #(issue number): Summarize your changes + + + +Closes # (issue number) + +## Checklist before requesting a review + +- [ ] Have you written simple and understandable explanation? +- [ ] Have you added new snippet into `snippets/` with suitable name and number? +- [ ] Have you updated Table of content? (later will be done by pre-commit) +- [ ] Have you followed the guidelines in [CONTRIBUTING.md](../../CONTRIBUTING.md)? +- [ ] Have you performed a self-review? +- [ ] Have you added yourself into [CONTRIBUTORS.md](../../CONTRIBUTORS.md)? diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md new file mode 100644 index 0000000..155780d --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -0,0 +1,13 @@ +## #(issue number): Summarize your changes + + + +Closes # (issue number) + +## Checklist before requesting a review + +- [ ] Have you followed the guidelines in [CONTRIBUTING.md](../../CONTRIBUTING.md)? +- [ ] Have you performed a self-review? +- [ ] Have you added yourself into [CONTRIBUTORS.md](../../CONTRIBUTORS.md)? + diff --git a/.github/PULL_REQUEST_TEMPLATE/translation.md b/.github/PULL_REQUEST_TEMPLATE/translation.md new file mode 100644 index 0000000..990a389 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/translation.md @@ -0,0 +1,13 @@ +## #(issue number): Translate to ... + + + +Closes # (issue number) + +## Checklist before requesting a review + +- [ ] Have you fetched the latest `master` branch? +- [ ] Have you translated all snippets? +- [ ] Have you followed the guidelines in [CONTRIBUTING.md](../../CONTRIBUTING.md)? +- [ ] Have you performed a self-review? +- [ ] Have you added yourself into [CONTRIBUTORS.md](../../CONTRIBUTORS.md)? diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dd9049d..771ece8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,19 @@ +# Contributing + +## Getting Started + +Contributions are made to this repo via Issues and Pull Requests (PRs). A few general guidelines that cover both: + +- Search for existing Issues and PRs before creating your own. +- We work hard to makes sure issues are handled in a timely manner but, depending on the impact, it could take a while to investigate the root cause. A friendly ping in the comment thread to the submitter or a contributor can help draw attention if your issue is blocking. + +## Issues + All kinds of patches are welcome. Feel free to even suggest some catchy and funny titles for the existing Examples. The goal is to make this collection as interesting to read as possible. Here are a few ways through which you can contribute, -- If you are interested in translating the project to another language (some people have done that in the past), please feel free to open up an issue, and let me know if you need any kind of help. +- If you are interested in translating the project to another language, please feel free to open up an issue using `translation` template, and let me know if you need any kind of help. - If the changes you suggest are significant, filing an issue before submitting the actual patch will be appreciated. If you'd like to work on the issue (highly encouraged), you can mention that you're interested in working on it while creating the issue and get assigned to it. -- If you're adding a new example, it is highly recommended to create an issue to discuss it before submitting a patch. You can use the following template for adding a new example: +- If you're adding a new example, it is highly recommended to create an issue using `new_snippet` template to discuss it before submitting a patch. You can use the following template for adding a new example:
 ### ▶ Some fancy Title *
@@ -33,31 +44,22 @@ Probably unexpected output
 ```
 
+## Pull requests -Few things that you can consider while writing an example, - -- If you are choosing to submit a new example without creating an issue and discussing, please check the project to make sure there aren't similar examples already. - Try to be consistent with the namings and the values you use with the variables. For instance, most variable names in the project are along the lines of `some_string`, `some_list`, `some_dict`, etc. You'd see a lot of `x`s for single letter variable names, and `"wtf"` as values for strings. There's no strictly enforced scheme in the project as such, but you can take a glance at other examples to get a gist. - Try to be as creative as possible to add that element of "surprise" in the setting up part of an example. Sometimes this may mean writing a snippet a sane programmer would never write. - Also, feel free to add your name to the [contributors list](/CONTRIBUTORS.md). -**Some FAQs** +## Common questions - What is is this after every snippet title (###) in the README: ? Should it be added manually or can it be ignored when creating new snippets? - -That's a random UUID, it is used to keep identify the examples across multiple translations of the project. As a contributor, you don't have to worry about behind the scenes of how it is used, you just have to add a new random UUID to new examples in that format. - - Where should new snippets be added? Top/bottom of the section, doesn't ? - -There are multiple things that are considered to decide the order (the dependency on the other examples, difficulty level, category, etc). I'd suggest simply adding the new example at the bottom of a section you find more fitting (or just add it to the Miscellaneous section). Its order will be taken care of in future revisions. - - What's the difference between the sections (the first two feel very similar)? - -The section "Strain your brain" contains more contrived examples that you may not really encounter in real life, whereas the section "Slippery Slopes" contains examples that have the potential to be encountered more frequently while programming. - - Before the table of contents it says that markdown-toc -i README.md --maxdepth 3 was used to create it. The pip package markdown-toc does not contain either -i or --maxdepth flags. Which package is meant, or what version of that package? - Should the new table of contents entry for the snippet be created with the above command or created manually (in case the above command does more than only add the entry)? - -We use the [markdown-toc](https://www.npmjs.com/package/markdown-toc) npm package to generate ToC. It has some issues with special characters though (I'm not sure if it's fixed yet). More often than not, I just end up inserting the toc link manually at the right place. The tool is handy when I have to big reordering, otherwise just updating toc manually is more convenient imo. +- What is is this after every snippet title (###) in the README: ? Should it be added manually or can it be ignored when creating new snippets? + - That's a random UUID, it is used to keep identify the examples across multiple translations of the project. As a contributor, you don't have to worry about behind the scenes of how it is used, you just have to add a new random UUID to new examples in that format. +- Where should new snippets be added? Top/bottom of the section, doesn't ? +- There are multiple things that are considered to decide the order (the dependency on the other examples, difficulty level, category, etc). I'd suggest simply adding the new example at the bottom of a section you find more fitting (or just add it to the Miscellaneous section). Its order will be taken care of in future revisions. +- What's the difference between the sections (the first two feel very similar)? + - The section "Strain your brain" contains more contrived examples that you may not really encounter in real life, whereas the section "Slippery Slopes" contains examples that have the potential to be encountered more frequently while programming. +- Before the table of contents it says that `markdown-toc -i README.md --maxdepth 3` was used to create it. The pip package `markdown-toc` does not contain neither `-i` nor `--maxdepth` flags. Which package is meant, or what version of that package? Should the new table of contents entry for the snippet be created with the above command or created manually (in case the above command does more than only add the entry)? + - `markdown-toc` will be replaced in the near future, follow the [issue](https://github.com/satwikkansal/wtfpython/issues/351) to check the progress. + - We use the [markdown-toc](https://www.npmjs.com/package/markdown-toc) npm package to generate ToC. It has some issues with special characters though (I'm not sure if it's fixed yet). More often than not, I just end up inserting the toc link manually at the right place. The tool is handy when I have to big reordering, otherwise just updating toc manually is more convenient imo. If you have any questions feel free to ask on [this issue](https://github.com/satwikkansal/wtfpython/issues/269) (thanks to [@LiquidFun](https://github.com/LiquidFun) for starting it).