From 1745c9782499ad0c6bd9a8b68a733b6bcc924734 Mon Sep 17 00:00:00 2001 From: unurgunite Date: Fri, 12 Jun 2026 23:45:06 +0300 Subject: [PATCH] [0.3.0] Add `CHANGELOG`, update `README`/`CONTRIBUTING`, add community files --- .github/ISSUE_TEMPLATE/bug_report.md | 36 +++++ .github/ISSUE_TEMPLATE/config.yml | 5 + .github/ISSUE_TEMPLATE/feature_request.md | 24 ++++ .github/PULL_REQUEST_TEMPLATE.md | 23 ++++ CHANGELOG.md | 32 ++++- CODE_OF_CONDUCT.md | 48 +++++-- CONTRIBUTING.md | 59 +++++++- README.md | 160 +++++++++++++++------- SECURITY.md | 14 ++ 9 files changed, 339 insertions(+), 62 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 SECURITY.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..7581674 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,36 @@ +--- +name: Bug report +about: Report a bug to help us improve +title: '' +labels: bug +assignees: '' + +--- + +## Description + + + +## Steps to reproduce + +1. +2. +3. + +## Expected behavior + + + +## Actual behavior + + + +## Environment + +- Ruby version: +- Gem version: +- OS: + +## Additional context + + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..f547360 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: Genius API Documentation + url: https://github.com/unurgunite/genius-api + about: Genius API documentation diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..8220a9f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,24 @@ +--- +name: Feature request +about: Suggest a new feature or improvement +title: '' +labels: enhancement +assignees: '' + +--- + +## Problem + + + +## Proposed solution + + + +## Alternatives + + + +## Additional context + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..782967b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,23 @@ +## Summary + + + +## Related issues + + + +## Checklist + +- [ ] `rubocop` — 0 offenses +- [ ] `rspec` — all tests pass +- [ ] `rbs validate` — OK +- [ ] `steep check` — no type errors +- [ ] `docscribe lib` — OK + +## Type of change + +- [ ] Bug fix +- [ ] New feature +- [ ] Refactoring +- [ ] Documentation +- [ ] CI / infrastructure diff --git a/CHANGELOG.md b/CHANGELOG.md index b10f498..4acc888 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,37 @@ ## [Unreleased] -## [0.1.0] - 2021-03-23 +## [0.3.0] - 2026-06-12 -- Initial release +### Added + +- Ruby >= 3.2 requirement +- RBS type signatures for all API modules and extensions +- RBS collection via `rbs_collection.yaml` +- Steep type checker setup +- `docscribe` gem for automated YARD documentation generation +- `.docscribe.yml` config with RBS integration (`rbs.enabled: true`, `rbs.collection: true`, `collapse_generics: true`) +- YARD documentation (100% documented, 0 warnings) +- CI/CD pipeline with GitHub Actions (rubocop, rspec, docscribe checks) +- CHANGELOG.md, CONTRIBUTING.md, CODE_OF_CONDUCT.md +- `bin/release` release script + +### Changed + +- Updated `actions/checkout` to v4, `ruby/setup-ruby` to v1 +- Updated `dotenv`, `parallel`, `rspec`, `rubocop`, `yard`, `coderay` dependencies +- Improved YARD annotations with meaningful descriptions and RBS-derived types +- README.md: updated requirements, added RBS/Steep/docscribe sections + +### Fixed + +- RuboCop offenses across all source files +- Anonymous block parameter YARD warning in `errors.rb` +- Type annotations aligned with RBS signatures ## [0.2.0] - 2022-04-03 - Updated documentation. Added first tests + +## [0.1.0] - 2021-03-23 + +- Initial release diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 51126f5..fc88789 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -2,7 +2,10 @@ ## 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, religion, or sexual identity and orientation. +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, 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. @@ -29,45 +32,62 @@ Examples of unacceptable behavior include: ## 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 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. +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. +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 the [issues page](https://github.com/unurgunite/genius-api/issues). All complaints will be reviewed and investigated promptly and fairly. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible +for enforcement at the [issues page](https://github.com/unurgunite/genius-api/issues). 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: +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. +**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. +**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. +**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. +**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. +**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. @@ -76,9 +96,11 @@ Community leaders will follow these Community Impact Guidelines in determining t This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. -Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). +Community Impact Guidelines were inspired +by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. +https://www.contributor-covenant.org/faq. Translations are available +at https://www.contributor-covenant.org/translations. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c1a6c8c..c11b190 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,11 @@ This file includes code style references which can help when contributing to pro 3. [Define methods][4.3] 5. [Contributing][5] 1. [Git commits][5.1] - 2. [Rubocop][5.2] + 2. [RuboCop][5.2] + 3. [RSpec][5.3] + 4. [Docscribe][5.4] + 5. [RBS][5.5] + 6. [Steep][5.6] 6. [TODO][6] 7. [License][7] @@ -256,6 +260,51 @@ See: [RuboCop documentation](https://docs.rubocop.org/rubocop/index.html) Before pushing, you must be sure that the code you write is correct, so it should always be formatted through a static analyzer. Look towards the `rubocop -D` and `rubocop -A` commands. +### RSpec + +Before pushing, run the test suite to ensure nothing is broken: + +```shell +bundle exec rspec +``` + +The test suite currently has 84 examples with 0 failures. + +### Docscribe + +Docscribe keeps YARD annotations in sync with the codebase. After making changes to method signatures, run: + +```shell +bundle exec docscribe lib +``` + +This will check for missing or outdated documentation. To regenerate annotations automatically: + +```shell +bundle exec docscribe -A --rbs-collection lib +``` + +The project's docscribe configuration is in `docscribe.yml` at the project root. + +### RBS + +RBS type signatures are located in `sig/` directory. After adding or changing methods, update the corresponding `.rbs` +files. Validate signatures with: + +```shell +bundle exec rbs validate +``` + +### Steep + +Steep performs static type checking using RBS signatures. Run the type checker: + +```shell +bundle exec steep check +``` + +All type errors must be resolved before committing. + ## TODO - [ ] Look at the documentation with fresh eyes @@ -306,6 +355,14 @@ the [CC BY-SA 4.0 License](https://creativecommons.org/licenses/by-sa/4.0/) [5.2]:https://github.com/unurgunite/genius-api/blob/master/CONTRIBUTING.md#rubocop +[5.3]:https://github.com/unurgunite/genius-api/blob/master/CONTRIBUTING.md#rspec + +[5.4]:https://github.com/unurgunite/genius-api/blob/master/CONTRIBUTING.md#docscribe + +[5.5]:https://github.com/unurgunite/genius-api/blob/master/CONTRIBUTING.md#rbs + +[5.6]:https://github.com/unurgunite/genius-api/blob/master/CONTRIBUTING.md#steep + [6]:https://github.com/unurgunite/genius-api/blob/master/CONTRIBUTING.md#todo [7]:https://github.com/unurgunite/genius-api/blob/master/CONTRIBUTING.md#license diff --git a/README.md b/README.md index 5cdbaba..41efd6e 100644 --- a/README.md +++ b/README.md @@ -14,15 +14,21 @@ API and much more! 2. [Automatic installation][2.1.2] 2. [Build via bundler][2.2] 3. [Usage][3] -4. [Todo][4] +4. [Requirements][4] + 1. [Common usage][4.1] + 2. [Development purposes][4.2] 5. [Development][5] -6. [Requirements][6] - 1. [Common usage][6.1] - 2. [Development purposes][6.2] -7. [Project style guide][7] -8. [Contributing][8] -9. [License][9] -10. [Code of Conduct][10] +6. [Type checking][6] + 1. [RBS][6.1] + 2. [Steep][6.2] +7. [Documentation][7] + 1. [YARD][7.1] + 2. [Docscribe][7.2] +8. [Project style guide][8] +9. [Contributing][9] +10. [License][10] +11. [Code of Conduct][11] +12. [TODO][12] ## Overview @@ -91,13 +97,35 @@ gem install genius-api All docs are available at the separate page: https://unurgunite.github.io/genius-api_docs/ -## TODO +## Requirements -- [x] Update `README.md` -- [ ] Refactor code base -- [x] Add tests with RSpec (76 examples, 0 failures) -- [ ] 100% code coverage with RuboCop -- [ ] Refactor code according to the style guides +This section will show dependencies which are used in the project. This section splits in two other sections — +requirements for common use and requirements for the development purposes. + +### Common use + +The `genius-api` gem requires Ruby >= 3.2 and is built on top of two other gems: + +| Dependencies | Description | +|-----------------|---------------------------------------------------------------------------------------------| +| [HTTParty][101] | The HTTParty gem is used to send requests to the REST client of the https://api.genius.com/ | +| [Nokogiri][102] | The Nokogiri gem is used to represent XML objects as Ruby structures. | + +### Development purposes + +For the development purposes `genius-api` gem uses: + +| Dependencies | Description | +|-----------------|------------------------------------------------------------------------------------------| +| [RSpec][201] | The RSpec gem is used for test which are located in a separate folder under `spec` name. | +| [RuboCop][202] | The RuboCop gem is used for code formatting. | +| [Rake][203] | The Rake gem is used for building tasks as generating documentation. | +| [Dotenv][204] | The Dotenv gem is used for setting variables for test environment (`token`, for e.g.). | +| [Coderay][205] | The Coderay gem is used for colorizing Rspec output. | +| [YARD][206] | The YARD gem is used for the documentation. | +| [RBS][207] | The RBS gem is used for Ruby type signatures. | +| [Steep][208] | The Steep gem is used for static type checking. | +| [Docscribe][209]| The Docscribe gem is used for automated YARD documentation generation. | ## Development @@ -108,32 +136,53 @@ To install this gem onto your local machine, run `bundle exec rake install`. To version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org). -## Requirements +## Type checking -This section will show dependencies which are used in the project. This section splits in two other sections — -requirements for common use and requirements for the development purposes. +This project uses RBS for type signatures and Steep for static type checking. -### Common use +### RBS -The `genius-api` gem is built on top of two other gems: +RBS type signatures are located in `sig/` directory. To validate them: -| Dependencies | Description | -|-----------------|---------------------------------------------------------------------------------------------| -| [HTTParty][101] | The HTTParty gem is used to send requests to the REST client of the https://api.genius.com/ | -| [Nokogiri][102] | The Nokogiri gem is used to represent XML objects as Ruby structures. | +```shell +bundle exec rbs validate +``` -### Development purposes +### Steep -For the development purposes `genius-api` gem uses: +To run the Steep type checker: + +```shell +bundle exec steep check +``` + +## Documentation + +This project uses YARD for documentation with Docscribe for automated annotation generation. + +### YARD + +To generate YARD documentation: + +```shell +bundle exec yard doc -o docs +``` + +Generated docs will be placed in `docs/` (gitignored). -| Dependencies | Description | -|----------------|------------------------------------------------------------------------------------------| -| [RSpec][201] | The RSpec gem is used for test which are located in a separate folder under `spec` name. | -| [RuboCop][202] | The RuboCop gem is used for code formatting. | -| [Rake][203] | The Rake gem is used for building tasks as generating documentation. | -| [Dotenv][204] | The Dotenv gem is used for setting variables for test environment (`token`, for e.g.). | -| [Coderay][205] | The Coderay gem is used for colorizing Rspec output. | -| [YARD][206] | The YARD gem is used for the documentation. | +### Docscribe + +Docscribe keeps YARD annotations in sync with the codebase. To check for missing or outdated docs: + +```shell +bundle exec docscribe lib +``` + +To regenerate annotations using RBS type information: + +```shell +bundle exec docscribe -A --rbs-collection lib +``` ## Project style guide @@ -158,11 +207,6 @@ git push origin refactor And then make new pull request with additional notes of what you have done. The better the changes are scheduled, the faster the PR will be checked. -## Code of Conduct - -Everyone interacting in the `Genius::Api` project's codebases, issue trackers, chat rooms and mailing lists is expected -to follow the [code of conduct](https://github.com/unurgunite/genius-api/blob/master/CODE_OF_CONDUCT.md). - ## License The gem is available as open source under the terms of the [GPLv3 License](https://opensource.org/licenses/GPL-3.0). The @@ -179,6 +223,12 @@ the [New BSD License](https://opensource.org/licenses/BSD-3-Clause) ![CC BY-SA 4.0](https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc.svg) ![BSD license logo](https://upload.wikimedia.org/wikipedia/commons/4/42/License_icon-bsd-88x31.png) +## TODO + +- [ ] Refactor code base +- [ ] 100% code coverage with RuboCop +- [ ] Refactor code according to the style guides + [1]:https://github.com/unurgunite/genius-api#overview [2]:https://github.com/unurgunite/genius-api#installation @@ -193,23 +243,35 @@ the [New BSD License](https://opensource.org/licenses/BSD-3-Clause) [3]:https://github.com/unurgunite/genius-api#usage -[4]:https://github.com/unurgunite/genius-api#todo +[4]:https://github.com/unurgunite/genius-api#requirements + +[4.1]:https://github.com/unurgunite/genius-api#common-usage + +[4.2]:https://github.com/unurgunite/genius-api#development-purposes [5]:https://github.com/unurgunite/genius-api#development -[6]:https://github.com/unurgunite/genius-api#requirements +[6]:https://github.com/unurgunite/genius-api#type-checking + +[6.1]:https://github.com/unurgunite/genius-api#rbs + +[6.2]:https://github.com/unurgunite/genius-api#steep + +[7]:https://github.com/unurgunite/genius-api#documentation -[6.1]:https://github.com/unurgunite/genius-api#common-usage +[7.1]:https://github.com/unurgunite/genius-api#yard -[6.2]:https://github.com/unurgunite/genius-api#development-purposes +[7.2]:https://github.com/unurgunite/genius-api#docscribe -[7]:https://github.com/unurgunite/genius-api#project-style-guide +[8]:https://github.com/unurgunite/genius-api#project-style-guide -[8]:https://github.com/unurgunite/genius-api#contributing +[9]:https://github.com/unurgunite/genius-api#contributing -[9]:https://github.com/unurgunite/genius-api#license +[10]:https://github.com/unurgunite/genius-api#license -[10]:https://github.com/unurgunite/genius-api#code-of-conduct +[11]:https://github.com/unurgunite/genius-api#code-of-conduct + +[12]:https://github.com/unurgunite/genius-api#todo [101]:https://rubygems.org/gems/httparty @@ -226,3 +288,9 @@ the [New BSD License](https://opensource.org/licenses/BSD-3-Clause) [205]:https://rubygems.org/gems/coderay [206]:https://rubygems.org/gems/yard + +[207]:https://rubygems.org/gems/rbs + +[208]:https://rubygems.org/gems/steep + +[209]:https://rubygems.org/gems/docscribe diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..60b4ea2 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,14 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +|---------|--------------------| +| 0.3.x | :white_check_mark: | +| < 0.3.0 | :x: | + +## Reporting a Vulnerability + +If you discover a security vulnerability, please do **not** open a public issue. Instead, send a private email to the maintainers at the address listed in the gem specification. + +We will acknowledge receipt within 48 hours and provide an estimated timeline for a fix.