From 667fe2cb096118c6a14c3276953e78715b0fd770 Mon Sep 17 00:00:00 2001 From: "Jing Xu(RainX)" Date: Mon, 11 Sep 2023 09:36:38 +0800 Subject: [PATCH 1/4] docs: add necessary documents for GitHub open-source project --- .github/ISSUE_TEMPLATE/01_BUG_REPORT.md | 37 +++++++++++++++ .github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md | 35 +++++++++++++++ .../ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md | 7 +++ .github/ISSUE_TEMPLATE/04_SUPPORT_QUESTION.md | 9 ++++ .github/ISSUE_TEMPLATE/config.yml | 2 + .github/PULL_REQUEST_TEMPLATE.md | 40 +++++++++++++++++ docs/CODE_OF_CONDUCT.md | 45 +++++++++++++++++++ docs/CONTRIBUTING.md | 44 ++++++++++++++++++ docs/SECURITY.md | 16 +++++++ 9 files changed, 235 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/01_BUG_REPORT.md create mode 100644 .github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md create mode 100644 .github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md create mode 100644 .github/ISSUE_TEMPLATE/04_SUPPORT_QUESTION.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 docs/CODE_OF_CONDUCT.md create mode 100644 docs/CONTRIBUTING.md create mode 100644 docs/SECURITY.md diff --git a/.github/ISSUE_TEMPLATE/01_BUG_REPORT.md b/.github/ISSUE_TEMPLATE/01_BUG_REPORT.md new file mode 100644 index 0000000..d52545c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/01_BUG_REPORT.md @@ -0,0 +1,37 @@ +--- +name: Bug Report +about: Create a report to help PHPDoc Parser to improve +title: "bug: " +labels: "bug" +assignees: "" +--- + +# Bug Report + +**PHPDoc Parser version:** + + + +**Current behavior:** + + + +**Expected behavior:** + + + +**Steps to reproduce:** + + + +**Related code:** + + + +``` +insert short code snippets here +``` + +**Other information:** + + diff --git a/.github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md b/.github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md new file mode 100644 index 0000000..5719147 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md @@ -0,0 +1,35 @@ +--- +name: Feature Request +about: Suggest an idea for this project +title: "feat: " +labels: "enhancement" +assignees: "" +--- + +# Feature Request + +**Describe the Feature Request** + + + +**Describe Preferred Solution** + + + +**Describe Alternatives** + + + +**Related Code** + + + +**Additional Context** + + + +**If the feature request is approved, would you be willing to submit a PR?** +_(Help can be provided if you need assistance submitting a PR)_ + +- [ ] Yes +- [ ] No diff --git a/.github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md b/.github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md new file mode 100644 index 0000000..bcd6cb7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md @@ -0,0 +1,7 @@ +--- +name: Codebase improvement +about: Provide your feedback for the existing codebase. Suggest a better solution for algorithms, development tools, etc. +title: "dev: " +labels: "enhancement" +assignees: "" +--- diff --git a/.github/ISSUE_TEMPLATE/04_SUPPORT_QUESTION.md b/.github/ISSUE_TEMPLATE/04_SUPPORT_QUESTION.md new file mode 100644 index 0000000..ca89bc0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/04_SUPPORT_QUESTION.md @@ -0,0 +1,9 @@ +--- +name: Support Question +about: Question on how to use this project +title: "support: " +labels: "question" +assignees: "" +--- + +# Support Question diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..bd9dfe4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,2 @@ +--- +blank_issues_enabled: false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..5d0b0b3 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,40 @@ + + +## Pull Request type + + + +Please check the type of change your PR introduces: + +- [ ] Bugfix +- [ ] Feature +- [ ] Code style update (formatting, renaming) +- [ ] Refactoring (no functional changes, no API changes) +- [ ] Build-related changes +- [ ] Documentation content changes +- [ ] Other (please describe): + +## What is the current behavior? + + + +Issue Number: N/A + +## What is the new behavior? + + + +- +- +- + +## Does this introduce a breaking change? + +- [ ] Yes +- [ ] No + + + +## Other information + + diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..475b17a --- /dev/null +++ b/docs/CODE_OF_CONDUCT.md @@ -0,0 +1,45 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers 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, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project email address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project maintainer(the address will be provided later). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4, available at + +For answers to common questions about this code of conduct, see diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 0000000..6f9d718 --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1,44 @@ +# Contributing + +When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change. +Please note we have a [code of conduct](CODE_OF_CONDUCT.md), please follow it in all your interactions with the project. + +## Development environment setup + +> **[?]** +> Proceed to describe how to setup local development environment. +> e.g: + +To set up a development environment, please follow these steps: + +1. Clone the repo + + ```sh + git clone https://github.com/RightCapitalHQ/phpdoc-parser + ``` + +2. TODO + +## Issues and feature requests + +You've found a bug in the source code, a mistake in the documentation or maybe you'd like a new feature? You can help us by [submitting an issue on GitHub](https://github.com/RightCapitalHQ/phpdoc-parser/issues). Before you create an issue, make sure to search the issue archive -- your issue may have already been addressed! + +Please try to create bug reports that are: + +- _Reproducible._ Include steps to reproduce the problem. +- _Specific._ Include as much detail as possible: which version, what environment, etc. +- _Unique._ Do not duplicate existing opened issues. +- _Scoped to a Single Bug._ One bug per report. + +**Even better: Submit a pull request with a fix or new feature!** + +### How to submit a Pull Request + +1. Search our repository for open or closed + [Pull Requests](https://github.com/RightCapitalHQ/phpdoc-parser/pulls) + that relate to your submission. You don't want to duplicate effort. +2. Fork the project +3. Create your feature branch (`git checkout -b feature/amazing_feature`) +4. Commit your changes (`git commit -m 'feat: add amazing_feature'`) PHPDoc Parser uses [conventional commits](https://www.conventionalcommits.org), so please follow the specification in your commit messages. +5. Push to the branch (`git push origin feature/amazing_feature`) +6. [Open a Pull Request](https://github.com/RightCapitalHQ/phpdoc-parser/compare?expand=1) diff --git a/docs/SECURITY.md b/docs/SECURITY.md new file mode 100644 index 0000000..1680e64 --- /dev/null +++ b/docs/SECURITY.md @@ -0,0 +1,16 @@ +# Security Policy + +## Reporting a Vulnerability + +If there are any vulnerabilities in **PHPDoc Parser**, don't hesitate to _report them_. + +1. Use the (the address will be provided later). +2. Describe the vulnerability. + + If you have a fix, that is most welcome -- please attach or summarize it in your message! + +3. We will evaluate the vulnerability and, if necessary, release a fix or mitigating steps to address it. We will contact you to let you know the outcome, and will credit you in the report. + + Please **do not disclose the vulnerability publicly** until a fix is released! + +4. Once we have either a) published a fix, or b) declined to address the vulnerability for whatever reason, you are free to publicly disclose it. From 327c3c965ea722ce8f12cd3044cda48727969f06 Mon Sep 17 00:00:00 2001 From: "Jing Xu(RainX)" Date: Mon, 11 Sep 2023 09:37:21 +0800 Subject: [PATCH 2/4] ci: add necessary GitHub workflows --- .github/labels.yml | 78 +++++++++++++++++++++++++++++++++ .github/workflows/codeql.yml | 20 +++++++++ .github/workflows/labels.yml | 21 +++++++++ .github/workflows/lock.yml | 32 ++++++++++++++ .github/workflows/pr-labels.yml | 20 +++++++++ .github/workflows/stale.yml | 44 +++++++++++++++++++ 6 files changed, 215 insertions(+) create mode 100644 .github/labels.yml create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/labels.yml create mode 100644 .github/workflows/lock.yml create mode 100644 .github/workflows/pr-labels.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 0000000..6fc63e1 --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,78 @@ +--- +- name: "breaking-change" + color: ee0701 + description: "A change that changes the API or breaks backward compatibility for users." +- name: "bugfix" + color: ee0701 + description: "Inconsistencies or issues which will cause a problem for users or implementors." +- name: "documentation" + color: 0052cc + description: "Solely about the documentation of the project." +- name: "enhancement" + color: 1d76db + description: "Enhancement of the code, not introducing new features." +- name: "refactor" + color: 1d76db + description: "Updating the code with simpler, easier to understand or more efficient syntax or methods, but not introducing new features." +- name: "performance" + color: 1d76db + description: "Improving performance of the project, not introducing new features." +- name: "new-feature" + color: 0e8a16 + description: "New features or options." +- name: "maintenance" + color: 2af79e + description: "Generic maintenance tasks." +- name: "ci" + color: 1d76db + description: "Work that improves the continuous integration." +- name: "dependencies" + color: 1d76db + description: "Change in project dependencies." + +- name: "in-progress" + color: fbca04 + description: "Issue is currently being worked on by a developer." +- name: "stale" + color: fef2c0 + description: "No activity for quite some time." +- name: "no-stale" + color: fef2c0 + description: "This is exempt from the stale bot." + +- name: "security" + color: ee0701 + description: "Addressing a vulnerability or security risk in this project." +- name: "incomplete" + color: fef2c0 + description: "Missing information." +- name: "invalid" + color: fef2c0 + description: "This is off-topic, spam, or otherwise doesn't apply to this project." + +- name: "beginner-friendly" + color: 0e8a16 + description: "Good first issue for people wanting to contribute to this project." +- name: "help-wanted" + color: 0e8a16 + description: "We need some extra helping hands or expertise in order to resolve this!" + +- name: "priority-critical" + color: ee0701 + description: "Must be addressed as soon as possible." +- name: "priority-high" + color: b60205 + description: "After critical issues are fixed, these should be dealt with before any further issues." +- name: "priority-medium" + color: 0e8a16 + description: "This issue may be useful, and needs some attention." +- name: "priority-low" + color: e4ea8a + description: "Nice addition, maybe... someday..." + +- name: "major" + color: b60205 + description: "This PR causes a major bump in the version number." +- name: "minor" + color: 0e8a16 + description: "This PR causes a minor bump in the version number." diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..7a537b4 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,20 @@ +--- +name: CodeQL + +on: + push: + pull_request: + schedule: + - cron: "30 1 * * 0" + +jobs: + codeql: + name: ๐Ÿญ Scanning + runs-on: ubuntu-latest + steps: + - name: โคต๏ธ Check out code from GitHub + uses: actions/checkout@v2 + - name: ๐Ÿ— Initialize CodeQL + uses: github/codeql-action/init@v1 + - name: ๐Ÿš€ Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml new file mode 100644 index 0000000..494824c --- /dev/null +++ b/.github/workflows/labels.yml @@ -0,0 +1,21 @@ +--- +name: Sync labels + +on: + push: + branches: + - main + paths: + - .github/labels.yml + +jobs: + labels: + name: โ™ป๏ธ Sync labels + runs-on: ubuntu-latest + steps: + - name: โคต๏ธ Check out code from GitHub + uses: actions/checkout@v2 + - name: ๐Ÿš€ Run Label Syncer + uses: micnncim/action-label-syncer@v1.2.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml new file mode 100644 index 0000000..20524e8 --- /dev/null +++ b/.github/workflows/lock.yml @@ -0,0 +1,32 @@ +--- +name: Lock + +on: + schedule: + - cron: "0 9 * * *" + workflow_dispatch: + +jobs: + lock: + name: ๐Ÿ”’ Lock closed issues and PRs + runs-on: ubuntu-latest + steps: + - uses: dessant/lock-threads@v2.0.3 + with: + github-token: ${{ github.token }} + issue-lock-inactive-days: "30" + issue-lock-reason: "" + issue-comment: > + Issue closed and locked due to lack of activity. + + If you encounter this same issue, please open a new issue and refer + to this closed one. + pr-lock-inactive-days: "1" + pr-lock-reason: "" + pr-comment: > + Pull Request closed and locked due to lack of activity. + + If you'd like to build on this closed PR, you can clone it using + this method: https://stackoverflow.com/a/14969986 + + Then open a new PR, referencing this closed PR in your message. diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml new file mode 100644 index 0000000..9f23629 --- /dev/null +++ b/.github/workflows/pr-labels.yml @@ -0,0 +1,20 @@ +--- +name: PR Labels + +on: + pull_request: + types: [opened, labeled, unlabeled, synchronize] + +jobs: + pr_labels: + name: ๐Ÿญ Verify + runs-on: ubuntu-latest + steps: + - name: ๐Ÿท Verify PR has a valid label + uses: jesusvasquez333/verify-pr-label-action@v1.4.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + valid-labels: >- + breaking-change, bugfix, documentation, enhancement, + refactor, performance, new-feature, maintenance, ci, dependencies + disable-reviews: true diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..5d5a671 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,44 @@ +--- +name: Stale + +on: + schedule: + - cron: "0 8 * * *" + workflow_dispatch: + +jobs: + stale: + name: ๐Ÿงน Clean up stale issues and PRs + runs-on: ubuntu-latest + steps: + - name: ๐Ÿš€ Run stale + uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-stale: 30 + days-before-close: 7 + remove-stale-when-updated: true + stale-issue-label: "stale" + exempt-issue-labels: "no-stale,help-wanted" + stale-issue-message: > + There hasn't been any activity on this issue recently, and in order + to prioritize active issues, it will be marked as stale. + + Please make sure to update to the latest version and + check if that solves the issue. Let us know if that works for you + by leaving a ๐Ÿ‘ + + Because this issue is marked as stale, it will be closed and locked + in 7 days if no further activity occurs. + + Thank you for your contributions! + stale-pr-label: "stale" + exempt-pr-labels: "no-stale" + stale-pr-message: > + There hasn't been any activity on this pull request recently, and in + order to prioritize active work, it has been marked as stale. + + This PR will be closed and locked in 7 days if no further activity + occurs. + + Thank you for your contributions! From 9b79f56fcce002444bdf6a71524af3eb51d03cf0 Mon Sep 17 00:00:00 2001 From: "Jing Xu(RainX)" Date: Mon, 11 Sep 2023 22:25:31 +0800 Subject: [PATCH 3/4] style: apply Pretty format suggestion --- .github/ISSUE_TEMPLATE/01_BUG_REPORT.md | 6 +- .github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md | 6 +- .../ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md | 6 +- .github/ISSUE_TEMPLATE/04_SUPPORT_QUESTION.md | 6 +- .github/labels.yml | 94 +++++++++---------- .github/workflows/codeql.yml | 2 +- .github/workflows/lock.yml | 10 +- .github/workflows/pr-labels.yml | 2 +- .github/workflows/stale.yml | 10 +- 9 files changed, 71 insertions(+), 71 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/01_BUG_REPORT.md b/.github/ISSUE_TEMPLATE/01_BUG_REPORT.md index d52545c..8235729 100644 --- a/.github/ISSUE_TEMPLATE/01_BUG_REPORT.md +++ b/.github/ISSUE_TEMPLATE/01_BUG_REPORT.md @@ -1,9 +1,9 @@ --- name: Bug Report about: Create a report to help PHPDoc Parser to improve -title: "bug: " -labels: "bug" -assignees: "" +title: 'bug: ' +labels: 'bug' +assignees: '' --- # Bug Report diff --git a/.github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md b/.github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md index 5719147..23516cf 100644 --- a/.github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md +++ b/.github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md @@ -1,9 +1,9 @@ --- name: Feature Request about: Suggest an idea for this project -title: "feat: " -labels: "enhancement" -assignees: "" +title: 'feat: ' +labels: 'enhancement' +assignees: '' --- # Feature Request diff --git a/.github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md b/.github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md index bcd6cb7..777076d 100644 --- a/.github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md +++ b/.github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md @@ -1,7 +1,7 @@ --- name: Codebase improvement about: Provide your feedback for the existing codebase. Suggest a better solution for algorithms, development tools, etc. -title: "dev: " -labels: "enhancement" -assignees: "" +title: 'dev: ' +labels: 'enhancement' +assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/04_SUPPORT_QUESTION.md b/.github/ISSUE_TEMPLATE/04_SUPPORT_QUESTION.md index ca89bc0..f58aa08 100644 --- a/.github/ISSUE_TEMPLATE/04_SUPPORT_QUESTION.md +++ b/.github/ISSUE_TEMPLATE/04_SUPPORT_QUESTION.md @@ -1,9 +1,9 @@ --- name: Support Question about: Question on how to use this project -title: "support: " -labels: "question" -assignees: "" +title: 'support: ' +labels: 'question' +assignees: '' --- # Support Question diff --git a/.github/labels.yml b/.github/labels.yml index 6fc63e1..d2708bb 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -1,78 +1,78 @@ --- -- name: "breaking-change" +- name: 'breaking-change' color: ee0701 - description: "A change that changes the API or breaks backward compatibility for users." -- name: "bugfix" + description: 'A change that changes the API or breaks backward compatibility for users.' +- name: 'bugfix' color: ee0701 - description: "Inconsistencies or issues which will cause a problem for users or implementors." -- name: "documentation" + description: 'Inconsistencies or issues which will cause a problem for users or implementors.' +- name: 'documentation' color: 0052cc - description: "Solely about the documentation of the project." -- name: "enhancement" + description: 'Solely about the documentation of the project.' +- name: 'enhancement' color: 1d76db - description: "Enhancement of the code, not introducing new features." -- name: "refactor" + description: 'Enhancement of the code, not introducing new features.' +- name: 'refactor' color: 1d76db - description: "Updating the code with simpler, easier to understand or more efficient syntax or methods, but not introducing new features." -- name: "performance" + description: 'Updating the code with simpler, easier to understand or more efficient syntax or methods, but not introducing new features.' +- name: 'performance' color: 1d76db - description: "Improving performance of the project, not introducing new features." -- name: "new-feature" + description: 'Improving performance of the project, not introducing new features.' +- name: 'new-feature' color: 0e8a16 - description: "New features or options." -- name: "maintenance" + description: 'New features or options.' +- name: 'maintenance' color: 2af79e - description: "Generic maintenance tasks." -- name: "ci" + description: 'Generic maintenance tasks.' +- name: 'ci' color: 1d76db - description: "Work that improves the continuous integration." -- name: "dependencies" + description: 'Work that improves the continuous integration.' +- name: 'dependencies' color: 1d76db - description: "Change in project dependencies." + description: 'Change in project dependencies.' -- name: "in-progress" +- name: 'in-progress' color: fbca04 - description: "Issue is currently being worked on by a developer." -- name: "stale" + description: 'Issue is currently being worked on by a developer.' +- name: 'stale' color: fef2c0 - description: "No activity for quite some time." -- name: "no-stale" + description: 'No activity for quite some time.' +- name: 'no-stale' color: fef2c0 - description: "This is exempt from the stale bot." + description: 'This is exempt from the stale bot.' -- name: "security" +- name: 'security' color: ee0701 - description: "Addressing a vulnerability or security risk in this project." -- name: "incomplete" + description: 'Addressing a vulnerability or security risk in this project.' +- name: 'incomplete' color: fef2c0 - description: "Missing information." -- name: "invalid" + description: 'Missing information.' +- name: 'invalid' color: fef2c0 description: "This is off-topic, spam, or otherwise doesn't apply to this project." -- name: "beginner-friendly" +- name: 'beginner-friendly' color: 0e8a16 - description: "Good first issue for people wanting to contribute to this project." -- name: "help-wanted" + description: 'Good first issue for people wanting to contribute to this project.' +- name: 'help-wanted' color: 0e8a16 - description: "We need some extra helping hands or expertise in order to resolve this!" + description: 'We need some extra helping hands or expertise in order to resolve this!' -- name: "priority-critical" +- name: 'priority-critical' color: ee0701 - description: "Must be addressed as soon as possible." -- name: "priority-high" + description: 'Must be addressed as soon as possible.' +- name: 'priority-high' color: b60205 - description: "After critical issues are fixed, these should be dealt with before any further issues." -- name: "priority-medium" + description: 'After critical issues are fixed, these should be dealt with before any further issues.' +- name: 'priority-medium' color: 0e8a16 - description: "This issue may be useful, and needs some attention." -- name: "priority-low" + description: 'This issue may be useful, and needs some attention.' +- name: 'priority-low' color: e4ea8a - description: "Nice addition, maybe... someday..." + description: 'Nice addition, maybe... someday...' -- name: "major" +- name: 'major' color: b60205 - description: "This PR causes a major bump in the version number." -- name: "minor" + description: 'This PR causes a major bump in the version number.' +- name: 'minor' color: 0e8a16 - description: "This PR causes a minor bump in the version number." + description: 'This PR causes a minor bump in the version number.' diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 7a537b4..d789477 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -5,7 +5,7 @@ on: push: pull_request: schedule: - - cron: "30 1 * * 0" + - cron: '30 1 * * 0' jobs: codeql: diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 20524e8..4cb4e5c 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -3,7 +3,7 @@ name: Lock on: schedule: - - cron: "0 9 * * *" + - cron: '0 9 * * *' workflow_dispatch: jobs: @@ -14,15 +14,15 @@ jobs: - uses: dessant/lock-threads@v2.0.3 with: github-token: ${{ github.token }} - issue-lock-inactive-days: "30" - issue-lock-reason: "" + issue-lock-inactive-days: '30' + issue-lock-reason: '' issue-comment: > Issue closed and locked due to lack of activity. If you encounter this same issue, please open a new issue and refer to this closed one. - pr-lock-inactive-days: "1" - pr-lock-reason: "" + pr-lock-inactive-days: '1' + pr-lock-reason: '' pr-comment: > Pull Request closed and locked due to lack of activity. diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml index 9f23629..dac53a0 100644 --- a/.github/workflows/pr-labels.yml +++ b/.github/workflows/pr-labels.yml @@ -13,7 +13,7 @@ jobs: - name: ๐Ÿท Verify PR has a valid label uses: jesusvasquez333/verify-pr-label-action@v1.4.0 with: - github-token: "${{ secrets.GITHUB_TOKEN }}" + github-token: '${{ secrets.GITHUB_TOKEN }}' valid-labels: >- breaking-change, bugfix, documentation, enhancement, refactor, performance, new-feature, maintenance, ci, dependencies diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 5d5a671..b767aaa 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -3,7 +3,7 @@ name: Stale on: schedule: - - cron: "0 8 * * *" + - cron: '0 8 * * *' workflow_dispatch: jobs: @@ -18,8 +18,8 @@ jobs: days-before-stale: 30 days-before-close: 7 remove-stale-when-updated: true - stale-issue-label: "stale" - exempt-issue-labels: "no-stale,help-wanted" + stale-issue-label: 'stale' + exempt-issue-labels: 'no-stale,help-wanted' stale-issue-message: > There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. @@ -32,8 +32,8 @@ jobs: in 7 days if no further activity occurs. Thank you for your contributions! - stale-pr-label: "stale" - exempt-pr-labels: "no-stale" + stale-pr-label: 'stale' + exempt-pr-labels: 'no-stale' stale-pr-message: > There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale. From fa9005476d75f1fc61f09e9346aa36134f117755 Mon Sep 17 00:00:00 2001 From: "Jing Xu(RainX)" Date: Sat, 16 Sep 2023 11:32:07 +0800 Subject: [PATCH 4/4] docs: add the development related sections to CONTRIBUTING document --- README.md | 2 ++ docs/CONTRIBUTING.md | 51 ++++++++++++++++++++++++++++++++++++++------ 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 875b5d1..ebc5dfb 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,8 @@ We are stilling waiting for someones to contribute, especially for the following - More docs - A script to monitor [upstream](https://github.com/phpstan/phpdoc-parser) updates and notify the author to catch up. +Please check out our [Contribution guide](docs/CONTRIBUTING.md) + ## How did we create the initial version of this project. We created most of our code by using ChatGPT as a tool to transform most code from https://github.com/phpstan/phpdoc-parser to TypeScript version. diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 6f9d718..95355eb 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -5,19 +5,58 @@ Please note we have a [code of conduct](CODE_OF_CONDUCT.md), please follow it in ## Development environment setup -> **[?]** -> Proceed to describe how to setup local development environment. -> e.g: - To set up a development environment, please follow these steps: -1. Clone the repo +1. Before cloning the repo, ensure you have the following softwares installed. + + - `Node.js` (You should install a [version manager](https://github.com/shadowspawn/node-version-usage) that could handle .node-version file) + - `pnpm` (You might have already installed it if you enabled the [Corepack](https://nodejs.org/api/corepack.html) feature) + - git + +2. Clone the repo ```sh git clone https://github.com/RightCapitalHQ/phpdoc-parser ``` -2. TODO +3. Install the dependencies + + ```sh + pnpm install + ``` + +## Guidelines + +- The code style follows the RightCapital [front-end style guide](https://github.com/RightCapitalHQ/frontend-style-guide) +- Some naming rules might be break. because for some variables or methods naming, we keep it the same as the upstream library(PHP version PHPDoc parer), It would make it easier to catch up the upstream changes. + + - eg. for the boolean variable/property name, our guide let us prefix the name with `is`, `has`, `can`, `should`, however, the upstream lib is not following this rule. so we just use the upstream's name. like `lines`, `indexes`, ``parseDescription`. + - Our style guide requires enum types to be named in camel case. but for the enum directly from upstream lib, we just use the all caps for the member of the enum. like + ```ts + enum ArrayShapeNodeKind { + ARRAY = 'array', + LIST = 'list', + } + ``` + +## Linting and testing the code. + +Please ensure your code is + +1. Passing the ESLint check and Prettier check +2. Passing all existing test cases + +and Your commit message is following the spec of the Conventional Commits ( https://www.conventionalcommits.org/ ) + +## Publishing and Changelog management + +we use [beachball](https://microsoft.github.io/beachball/) to automate the npm publishing and changelog. when you fire a PR. the only thing the contributor needs to take care is ensuring run + +```sh +pnpm change +``` + +to generate appropriate change file for us to bump the version and generate the changelog ## Issues and feature requests