From 3156eb91080f7e620cd9bcc94ced04831fb7f181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BF=B7=E5=AD=90=20=28Maiko=20Tan=29?= Date: Sun, 29 May 2022 04:04:42 +0000 Subject: [PATCH 1/4] chore: update contributing guide --- CODE_OF_CONDUCT.md | 223 +++++++++++++++++++++ .github/contributing.md => CONTRIBUTING.md | 31 ++- packages/koishi/readme.md | 2 +- 3 files changed, 247 insertions(+), 9 deletions(-) create mode 100644 CODE_OF_CONDUCT.md rename .github/contributing.md => CONTRIBUTING.md (53%) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..a96fb2acd4 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,223 @@ + +# Contributor Covenant Code of Conduct + +[简体中文](#贡献者公约) + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations + +# 贡献者公约 + +## 我们的承诺 + +身为社区成员、贡献者和领袖,我们承诺使社区参与者不受骚扰,无论其年龄、体型、可见或不可见的缺陷、族裔、性征、性别认同和表达、经验水平、教育程度、社会与经济地位、国籍、相貌、种族、种姓、肤色、宗教信仰、性倾向或性取向如何。 + +我们承诺以有助于建立开放、友善、多样化、包容、健康社区的方式行事和互动。 + +## 我们的准则 + +有助于为我们的社区创造积极环境的行为例子包括但不限于: + +* 表现出对他人的同情和善意 +* 尊重不同的主张、观点和感受 +* 提出和大方接受建设性意见 +* 承担责任并向受我们错误影响的人道歉 +* 注重社区共同诉求,而非个人得失 + +不当行为例子包括: + +* 使用情色化的语言或图像,及性引诱或挑逗 +* 嘲弄、侮辱或诋毁性评论,以及人身或政治攻击 +* 公开或私下的骚扰行为 +* 未经他人明确许可,公布他人的私人信息,如物理或电子邮件地址 +* 其他有理由认定为违反职业操守的不当行为 + +## 责任和权力 + +社区领袖有责任解释和落实我们所认可的行为准则,并妥善公正地对他们认为不当、威胁、冒犯或有害的任何行为采取纠正措施。 + +社区领导有权力和责任删除、编辑或拒绝或拒绝与本行为准则不相符的评论(comment)、提交(commits)、代码、维基(wiki)编辑、议题(issues)或其他贡献,并在适当时机知采取措施的理由。 + +## 适用范围 + +本行为准则适用于所有社区场合,也适用于在公共场所代表社区时的个人。 + +代表社区的情形包括使用官方电子邮件地址、通过官方社交媒体帐户发帖或在线上或线下活动中担任指定代表。 + +## 监督 + +辱骂、骚扰或其他不可接受的行为可通过 向负责监督的社区领袖报告。 +所有投诉都将得到及时和公平的审查和调查。 + +所有社区领袖都有义务尊重任何事件报告者的隐私和安全。 + +## 处理方针 + +社区领袖将遵循下列社区处理方针来明确他们所认定违反本行为准则的行为的处理方式: + +### 1. 纠正 + +**社区影响**:使用不恰当的语言或其他在社区中被认定为不符合职业道德或不受欢迎的行为。 + +**处理意见**:由社区领袖发出非公开的书面警告,明确说明违规行为的性质,并解释举止如何不妥。或将要求公开道歉。 + +### 2. 警告 + +**社区影响**:单个或一系列违规行为。 + +**处理意见**:警告并对连续性行为进行处理。在指定时间内,不得与相关人员互动,包括主动与行为准则执行者互动。这包括避免在社区场所和外部渠道中的互动。违反这些条款可能会导致临时或永久封禁。 + +### 3. 临时封禁 + +**社区影响**: 严重违反社区准则,包括持续的不当行为。 + +**处理意见**: 在指定时间内,暂时禁止与社区进行任何形式的互动或公开交流。在此期间,不得与相关人员进行公开或私下互动,包括主动与行为准则执行者互动。违反这些条款可能会导致永久封禁。 + +### 4. 永久封禁 + +**社区影响**:行为模式表现出违反社区准则,包括持续的不当行为、骚扰个人或攻击或贬低某个类别的个体。 + +**处理意见**:永久禁止在社区内进行任何形式的公开互动。 + +## 参见 + +本行为准则改编自 [Contributor Covenant][homepage] 2.1 版, 参见 [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]。 + +社区处理方针灵感来源于 [Mozilla's code of conduct enforcement ladder][Mozilla CoC]。 + +有关本行为准则的常见问题的答案,参见 [https://www.contributor-covenant.org/faq][FAQ]。 +其他语言翻译参见 [https://www.contributor-covenant.org/translations][translations]。 + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/.github/contributing.md b/CONTRIBUTING.md similarity index 53% rename from .github/contributing.md rename to CONTRIBUTING.md index 669f469a4a..e210d9f190 100644 --- a/.github/contributing.md +++ b/CONTRIBUTING.md @@ -1,27 +1,41 @@ # 贡献指南 -Koishi 是一个相当大的仓库,里面包含了各种各样的插件和适配器。作者在写完这一切以后才终于发现自己挖了一个不得了的大坑,并且并没有精力维护如此多的功能。因此,我们非常鼓励您亲自动手,参与到 Koishi 及其生态的开发中。同时,基于您对本仓库的贡献,我们也会在适当的时机邀请您成为本仓库的 collaborator。 +:tada: 首先,感谢你抽出宝贵的时间向 Koishi 贡献,正是因为有像你一样的贡献者存在,才让 Koishi 如此强大。 -## 在你贡献之前需要知道 +Koishi 是一个相当大的仓库,包含了各种各样的插件和适配器。目前整个项目由 Koishi 开发团队进行维护,核心模块由 [@shigma](https://github.com/shigma) 主导开发和设计。 -### 我能给已有的库增加新特性吗? +请你在贡献之前阅读该指南的各个章节,以便了解如何向 Koishi 贡献,这不仅能节约双方的时间和精力,还可以让开发团队成员可以更好地追踪 Bug,跟踪 Issue,以及帮助你完成你的 Pull Request。 +同时,我们希望你能遵循[贡献者公约](./CODE_OF_CONDUCT.md)中的各项要求,做到友好和善,一同创建良好的开源环境。 + +我们会邀请积极的贡献者加入我们的开发团队。 + +## 开始之前 + +- 如果你不知道应该从哪里开始入手,可以加入 [Discord](https://discord.gg/xfxYwmd284) 讨论。 +- 如果你想要报告 Bug 或者提出新的功能,可以在 [Github](https://github.com/koishijs/koishi/issues/new/choose) 上提出一个 Issue。 + +## 可以贡献的范围(我可以贡献__吗?) + +- 为已有的库添加新的特性 当然可以。不过在此之前建议你发一个 feature request 或者在官方群中与作者交流意见。这是为了确保你写的东西不会让别人的机器人挂掉。 -### 我能贡献一个新的平台/数据库实现吗? +- 贡献一个新的平台/数据库实现 非常欢迎。不过你需要知道平台和数据库实现非常底层的东西,建议你在写之前熟悉一下 Koishi 的基本架构和文档。如果有什么疑问,也可以在 issues 或者官方群中提出。 -### 我能贡献一个新的插件吗? +- 贡献一个新的插件 -Koishi 至今为止的官方插件数量已经非常非常多了,比起创建一个新的官方插件,作者更愿意见到社区插件丰富起来。你可以自己进行开发,然后列在[**这里**](https://github.com/koishijs/koishi#社区插件)。对于活跃的社区贡献者,我们也会邀请其成为 koishijs 的成员(现在已经有不少了)。 +Koishi 至今为止的官方插件数量已经非常非常多了,比起创建一个新的官方插件,我们更愿意见到社区插件丰富起来。 +只要你为自己的插件添加上合适的前缀(如 `koishi-plugin-bar` 或 `@foo/koishi-plugin-bar`),Koishi 的插件市场便会自动收录。 +对于活跃的社区贡献者,我们也会邀请其成为 koishijs 的成员(现在已经有不少了)。 ## 如何发送 Pull Request ### 基本流程 1. fork 这个仓库 -2. 检出 develop 分支(注意不是 master) +2. 检出 master 分支 3. 在 HEAD 处创建一个自己的分支,比如 my-feature 4. 进行你的开发 5. 创建 pull request 到 develop 分支 @@ -30,7 +44,8 @@ Koishi 至今为止的官方插件数量已经非常非常多了,比起创建 1. 你交上来的所有文件应该是 ts 格式的并且能通过 yarn lint;如果你不熟悉 TypeScript,可以先发 draft PR 并在其中说明缘由 2. 如果是给已经有测试用例的库提交 PR,请确保单元测试依然通过;如果增加了新特性,请自行补充对应的单元测试 -3. 我们不对 PR 中的 commit message 做硬性规定,但如果 PR 中所有的 commit message 均满足本仓库的要求,我会考虑使用 merge,其他情况下我都会使用 squash。这将影响你向本仓库贡献的 commit 数量。具体细节参见下一节 +3. 如果你的更改涉及多个功能,请尽量分成多个 PR,这样可以更好的维护这些功能的兼容性 +4. 我们将使用 squash 方式合并 PR,请保证你的标题符合下一节描述的格式。如果你的 PR 中包含多于一个 commit,尽量让每一个 commit message 都符合该格式 ### 如何编写 Commit Message diff --git a/packages/koishi/readme.md b/packages/koishi/readme.md index 9a578fcdec..c4115d6db1 100644 --- a/packages/koishi/readme.md +++ b/packages/koishi/readme.md @@ -57,7 +57,7 @@ Copyright © 2019-2022, Shigma ## 贡献指南 -[请看这里](./.github/contributing.md) +[请看这里](./CONTRIBUTING.md) ## 联系方式 From 68da4822c917f38d9b832f6afc54e3e05b8d67e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BF=B7=E5=AD=90=20=28Maiko=20Tan=29?= Date: Fri, 10 Jun 2022 08:05:54 +0000 Subject: [PATCH 2/4] docs: 'wiki' -> 'documentation', 'community leaders' -> 'maintainers' --- CODE_OF_CONDUCT.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index a96fb2acd4..c0ac8a3c6e 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -5,7 +5,7 @@ ## Our Pledge -We as members, contributors, and leaders pledge to make participation in our +We as members and contributors pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, @@ -41,13 +41,13 @@ Examples of unacceptable behavior include: ## Enforcement Responsibilities -Community leaders are responsible for clarifying and enforcing our standards of +Maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are +Maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, documentation edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. @@ -62,16 +62,16 @@ representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at +reported to the maintainers responsible for enforcement at . All complaints will be reviewed and investigated promptly and fairly. -All community leaders are obligated to respect the privacy and security of the +All maintainers are obligated to respect the privacy and security of the reporter of any incident. ## Enforcement Guidelines -Community leaders will follow these Community Impact Guidelines in determining +Maintainers will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction @@ -79,7 +79,7 @@ the consequences for any action they deem in violation of this Code of Conduct: **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. -**Consequence**: A private, written warning from community leaders, providing +**Consequence**: A private, written warning from maintainers, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. @@ -138,7 +138,7 @@ For answers to common questions about this code of conduct, see the FAQ at ## 我们的承诺 -身为社区成员、贡献者和领袖,我们承诺使社区参与者不受骚扰,无论其年龄、体型、可见或不可见的缺陷、族裔、性征、性别认同和表达、经验水平、教育程度、社会与经济地位、国籍、相貌、种族、种姓、肤色、宗教信仰、性倾向或性取向如何。 +身为社区成员和贡献者,我们承诺使社区参与者不受骚扰,无论其年龄、体型、可见或不可见的缺陷、族裔、性征、性别认同和表达、经验水平、教育程度、社会与经济地位、国籍、相貌、种族、种姓、肤色、宗教信仰、性倾向或性取向如何。 我们承诺以有助于建立开放、友善、多样化、包容、健康社区的方式行事和互动。 @@ -162,9 +162,9 @@ For answers to common questions about this code of conduct, see the FAQ at ## 责任和权力 -社区领袖有责任解释和落实我们所认可的行为准则,并妥善公正地对他们认为不当、威胁、冒犯或有害的任何行为采取纠正措施。 +维护者有责任解释和落实我们所认可的行为准则,并妥善公正地对他们认为不当、威胁、冒犯或有害的任何行为采取纠正措施。 -社区领导有权力和责任删除、编辑或拒绝或拒绝与本行为准则不相符的评论(comment)、提交(commits)、代码、维基(wiki)编辑、议题(issues)或其他贡献,并在适当时机知采取措施的理由。 +维护者有权力和责任删除、编辑或拒绝或拒绝与本行为准则不相符的评论(comment)、提交(commits)、代码、文档(documentation)编辑、议题(issues)或其他贡献,并在适当时机知采取措施的理由。 ## 适用范围 @@ -174,20 +174,20 @@ For answers to common questions about this code of conduct, see the FAQ at ## 监督 -辱骂、骚扰或其他不可接受的行为可通过 向负责监督的社区领袖报告。 +辱骂、骚扰或其他不可接受的行为可通过 向负责监督的维护者报告。 所有投诉都将得到及时和公平的审查和调查。 -所有社区领袖都有义务尊重任何事件报告者的隐私和安全。 +所有维护者都有义务尊重任何事件报告者的隐私和安全。 ## 处理方针 -社区领袖将遵循下列社区处理方针来明确他们所认定违反本行为准则的行为的处理方式: +维护者将遵循下列社区处理方针来明确他们所认定违反本行为准则的行为的处理方式: ### 1. 纠正 **社区影响**:使用不恰当的语言或其他在社区中被认定为不符合职业道德或不受欢迎的行为。 -**处理意见**:由社区领袖发出非公开的书面警告,明确说明违规行为的性质,并解释举止如何不妥。或将要求公开道歉。 +**处理意见**:由维护者发出非公开的书面警告,明确说明违规行为的性质,并解释举止如何不妥。或将要求公开道歉。 ### 2. 警告 From e3d0e6afb0a634dbafee7193b405608e4ebfb6f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BF=B7=E5=AD=90=20=28Maiko=20Tan=29?= Date: Fri, 10 Jun 2022 08:36:36 +0000 Subject: [PATCH 3/4] fix; some words --- CODE_OF_CONDUCT.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index c0ac8a3c6e..c35e64fee2 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -5,7 +5,7 @@ ## Our Pledge -We as members and contributors pledge to make participation in our +We as members, contributors and maintainers pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, @@ -47,7 +47,7 @@ response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, documentation edits, issues, and other contributions that are +comments, commits, code, documentation, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. From 3069b3395690e01c0bc1f589985fd1255dd37b15 Mon Sep 17 00:00:00 2001 From: Maiko Sinkyaet Tan Date: Fri, 10 Jun 2022 16:46:20 +0800 Subject: [PATCH 4/4] apply suggestions --- CODE_OF_CONDUCT.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index c35e64fee2..85b1bdbab3 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -47,7 +47,7 @@ response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, documentation, issues, and other contributions that are +code, documentation, comments, commits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. @@ -138,7 +138,7 @@ For answers to common questions about this code of conduct, see the FAQ at ## 我们的承诺 -身为社区成员和贡献者,我们承诺使社区参与者不受骚扰,无论其年龄、体型、可见或不可见的缺陷、族裔、性征、性别认同和表达、经验水平、教育程度、社会与经济地位、国籍、相貌、种族、种姓、肤色、宗教信仰、性倾向或性取向如何。 +身为社区成员、贡献者和维护者,我们承诺使社区参与者不受骚扰,无论其年龄、体型、可见或不可见的缺陷、族裔、性征、性别认同和表达、经验水平、教育程度、社会与经济地位、国籍、相貌、种族、种姓、肤色、宗教信仰、性倾向或性取向如何。 我们承诺以有助于建立开放、友善、多样化、包容、健康社区的方式行事和互动。 @@ -164,7 +164,7 @@ For answers to common questions about this code of conduct, see the FAQ at 维护者有责任解释和落实我们所认可的行为准则,并妥善公正地对他们认为不当、威胁、冒犯或有害的任何行为采取纠正措施。 -维护者有权力和责任删除、编辑或拒绝或拒绝与本行为准则不相符的评论(comment)、提交(commits)、代码、文档(documentation)编辑、议题(issues)或其他贡献,并在适当时机知采取措施的理由。 +维护者有权力和责任删除、编辑或拒绝或拒绝与本行为准则不相符的代码、文档、评论(comment)、提交(commits)、议题(issues)或其他贡献,并在适当时机知采取措施的理由。 ## 适用范围