From 2229c638f9c4eb9e93bc9e7dada1e0fb2796f6ca Mon Sep 17 00:00:00 2001 From: Hans Kokx Date: Wed, 13 May 2026 13:58:28 +0200 Subject: [PATCH 1/2] Add issue templates, contribution guidelines, and code of conduct; update CI/CD workflows and project metadata Signed-off-by: Hans Kokx --- .github/ISSUE_TEMPLATE/bug.md | 62 ++++++++++++++++ .github/ISSUE_TEMPLATE/feature.md | 65 +++++++++++++++++ .github/ISSUE_TEMPLATE/qa.md | 70 ++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 27 +++++++ {.gitea => .github}/workflows/ci.yml | 0 {.gitea => .github}/workflows/release.yml | 0 .gitignore | 41 +++++++++-- .pubignore | 5 ++ CHANGELOG.md | 4 ++ CODE_OF_CONDUCT.md | 86 +++++++++++++++++++++++ CONTRIBUTING.md | 81 +++++++++++++++++++++ lib/list_or.dart | 2 +- pubspec.yaml | 5 +- 13 files changed, 441 insertions(+), 7 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug.md create mode 100644 .github/ISSUE_TEMPLATE/feature.md create mode 100644 .github/ISSUE_TEMPLATE/qa.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md rename {.gitea => .github}/workflows/ci.yml (100%) rename {.gitea => .github}/workflows/release.yml (100%) create mode 100644 .pubignore create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000..bc7ea6f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,62 @@ +--- +name: 🐛 Bug Report +about: Report a reproducible bug to help us improve the project +title: "[bug]: " +labels: bug +assignees: "" +--- + + + +### Checklist + +- [ ] I have searched existing issues to ensure this bug hasn’t been reported yet. +- [ ] I have provided enough information for others to reproduce this bug. +- [ ] I have encountered this issue at least twice +- [ ] I have filled out all the information below + +> ⚠️ Please do not open an issue if you've encountered the undesired behavior only once. +> Document your findings and include them in an issue when you can encounter the issue at least a second time + +## Description + +**Type** + +- [ ] 💥 Crash +- [ ] ✖️ Build error +- [ ] 🫨 Instability +- [ ] 🤔 Other (please specify): + +**Encountered Behavior** + + +**Expected Behavior** + + +**Steps/Code Snippet to Reproduce** + + +**Git Hash / Commit ID** + + +--- + +## System Specs + +- **CPU** (model + architecture): +- **GPU** (model + driver version): +- **Operating System & Version**: +- **Compiler / Build Tool Versions** (if relevant): + +--- + +## Additional Context + +**Logs / Error Output** + + +**Screenshots/Screencasts (if applicable)** + + +**Workarounds Tried (optional)** + diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md new file mode 100644 index 0000000..bfbded5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.md @@ -0,0 +1,65 @@ +--- +name: ✨ Feature Request +about: Suggest a new feature or improvement for the project +title: "[feature]: " +labels: enhancement +assignees: "" +--- + + + +### Checklist + +- [ ] I have searched existing issues and discussions to ensure this feature hasn’t been suggested yet. +- [ ] I have clearly described the problem this feature would solve. +- [ ] I have outlined how this feature would improve the project for users or developers. +- [ ] I have filled out all the information below. + +## Summary + +**Feature Type** + +- [ ] 🚀 End-user functionality +- [ ] 📦 Integration / New API +- [ ] 🎨 UI/UX improvement +- [ ] ⚡ Performance optimization +- [ ] 🧠 Developer experience improvement +- [ ] 🤔 Other (please specify): + +**Problem / Motivation** + + +**Proposed Solution / Feature Description** + + +**Alternatives Considered** + + +--- + +## Impact and Scope + +**Who Benefits** + + +**Possible Risks or Tradeoffs** + + +**Priority Level** + +- [ ] 💚 Nice-to-have +- [ ] 💖 Important +- [ ] 🔥 Critical / Blocking + +--- + +## Additional Context + +**Related Issues / PRs** + + +**Mockups / Diagrams / Examples (optional)** + + +**Notes or References (optional)** + diff --git a/.github/ISSUE_TEMPLATE/qa.md b/.github/ISSUE_TEMPLATE/qa.md new file mode 100644 index 0000000..4e54649 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/qa.md @@ -0,0 +1,70 @@ +--- +name: 😓 QA Issue +about: Report a QA issue you've encountered +title: "[qa]: " +labels: qa +assignees: "" +--- + + + +### Checklist + +- [ ] I have searched existing issues to ensure this hasn’t been reported yet. +- [ ] I have provided enough information for others to identify the issue. +- [ ] I have encountered this issue at least twice +- [ ] I have filled out all the information below + +> ⚠️ Please do not open an issue if you've encountered the undesired behavior only once. +> Document your findings and include them in an issue when you can encounter the issue at least a second time + +## Description + +**Type** + +- [ ] 🔍 Analyzer/Lint/Tidy +- [ ] 📏 Formatting +- [ ] 🎨 Code style +- [ ] 🛠️ Build issue +- [ ] 📚 Documentation +- [ ] 🧪 Test failure/coverage +- [ ] 🔄 CI/CD +- [ ] ⚡ Performance (CPU/GPU/Memory usage, latency, etc.) +- [ ] 📦 Installation/Setup +- [ ] 🔌 API +- [ ] 🤔 Other (please specify): + +**Encountered Behavior** + + +**Expected Behavior** + + +**Steps/Code Snippet to Reproduce** + + +**Version tag / Git commit** + + +--- + +## System Specs (if applicable) + + +- **CPU** (model + architecture): +- **GPU** (model + driver version): +- **Operating System & Version**: +- **Compiler / Build Tool Versions** (if relevant): + +--- + +## Additional Context + +**Logs / Error Output** + + +**Screenshots/Screencasts (if applicable)** + + +**Workarounds Tried (optional)** + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..790a6db --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,27 @@ + + + + +## Related issue(s) + + +## Type of Change + + +- [ ] ✨ Feature (new API/UI/functionality) +- [ ] 🐛 Bug fix (fixes an issue) +- [ ] ❌ Breaking change (a change that would cause existing functionality to work differently or break) +- [ ] 🧹 Code refactor +- [ ] ✅ CI/CD/Build configuration change +- [ ] 📚 Documentation +- [ ] 🧹 Chore + +## Description + diff --git a/.gitea/workflows/ci.yml b/.github/workflows/ci.yml similarity index 100% rename from .gitea/workflows/ci.yml rename to .github/workflows/ci.yml diff --git a/.gitea/workflows/release.yml b/.github/workflows/release.yml similarity index 100% rename from .gitea/workflows/release.yml rename to .github/workflows/release.yml diff --git a/.gitignore b/.gitignore index 3cceda5..7a43e7d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,38 @@ -# https://dart.dev/guides/libraries/private-files -# Created by `dart pub` -.dart_tool/ +# See https://www.dartlang.org/guides/libraries/private-files -# Avoid committing pubspec.lock for library packages; see -# https://dart.dev/guides/libraries/private-files#pubspeclock. +# Files and directories created by pub +.dart_tool/ +.packages +# If you're building an application, you may want to check-in your pubspec.lock pubspec.lock +*.g.dart + +# Directory created by dartdoc +# If you don't generate documentation locally you can remove this line. +doc/api/ + +# dotenv environment variables file +.env* + +# Build files +build/ +.idea/ +*.iml + +# Avoid committing generated Javascript files: +*.dart.js +# Produced by the --dump-info flag. +*.info.json +# When generated by dart2js. Don't specify *.js if your +# project includes source files written in JavaScript. +*.js +*.js_ +*.js.deps +*.js.map + +.flutter-plugins +.flutter-plugins-dependencies + +# OS generated files +.DS_Store +Thumbs.db diff --git a/.pubignore b/.pubignore new file mode 100644 index 0000000..a15142a --- /dev/null +++ b/.pubignore @@ -0,0 +1,5 @@ +.github/ +.dart_tool/ +build/ +*.g.dart +screenshots/ diff --git a/CHANGELOG.md b/CHANGELOG.md index effe43c..b126edb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ ## 1.0.0 +- `toString` no longer tries `firstOrNull` as it should never return null. + +## 1.0.0 + - Initial version. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..234f62f --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,86 @@ + +# Contributor Covenant 3.0 Code of Conduct + +## Our Pledge + +We pledge to make our community welcoming, safe, and equitable for all. + +We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant. + +## Encouraged Behaviors + +While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language. + +With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including: + +1. Respecting the **purpose of our community**, our activities, and our ways of gathering. +2. Engaging **kindly and honestly** with others. +3. Respecting **different viewpoints** and experiences. +4. **Taking responsibility** for our actions and contributions. +5. Gracefully giving and accepting **constructive feedback**. +6. Committing to **repairing harm** when it occurs. +7. Behaving in other ways that promote and sustain the **well-being of our community**. + +## Restricted Behaviors + +We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct. + +1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop. +2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people. +3. **Stereotyping or discrimination.** Characterizing anyone’s personality or behavior on the basis of immutable identities or traits. +4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community. +5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission. +6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group. +7. Behaving in other ways that **threaten the well-being** of our community. + +### Other Restrictions + +1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions. +2. **Failing to credit sources.** Not properly crediting the sources of content you contribute. +3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community. +4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors. + +## Reporting an Issue + +Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm. + +When an incident does occur, it is important to report it promptly. To report a possible violation, **contact the maintainers via their social media accounts or email address, as listed on their profile** + +Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution. + +## Addressing and Repairing Harm + +**[NOTE: The remedies and repairs outlined below are suggestions based on best practices in code of conduct enforcement. If your community has its own established enforcement process, be sure to edit this section to describe your own policies.]** + +If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident's impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped. + +1) Warning + 1) Event: A violation involving a single incident or series of incidents. + 2) Consequence: A private, written warning from the Community Moderators. + 3) Repair: Examples of repair include a private written apology, acknowledgement of responsibility, and seeking clarification on expectations. +2) Temporarily Limited Activities + 1) Event: A repeated incidence of a violation that previously resulted in a warning, or the first incidence of a more serious violation. + 2) Consequence: A private, written warning with a time-limited cooldown period designed to underscore the seriousness of the situation and give the community members involved time to process the incident. The cooldown period may be limited to particular communication channels or interactions with particular community members. + 3) Repair: Examples of repair may include making an apology, using the cooldown period to reflect on actions and impact, and being thoughtful about re-entering community spaces after the period is over. +3) Temporary Suspension + 1) Event: A pattern of repeated violation which the Community Moderators have tried to address with warnings, or a single serious violation. + 2) Consequence: A private written warning with conditions for return from suspension. In general, temporary suspensions give the person being suspended time to reflect upon their behavior and possible corrective actions. + 3) Repair: Examples of repair include respecting the spirit of the suspension, meeting the specified conditions for return, and being thoughtful about how to reintegrate with the community when the suspension is lifted. +4) Permanent Ban + 1) Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member. + 2) Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior. + 3) Repair: There is no possible repair in cases of this severity. + +This enforcement ladder is intended as a guideline. It does not limit the ability of Community Managers to use their discretion and judgment, in keeping with the best interests of our community. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public or other spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/). + +Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/) + +For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of [Mozilla’s code of conduct team](https://github.com/mozilla/inclusion). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..8153caf --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,81 @@ +# Contributing + +Thanks for taking the time to contribute — you’re helping make the Dart ecosystem better. + +By participating in this project, you agree to follow our [Code of Conduct](CODE_OF_CONDUCT.md). + +## Ways to contribute + +- Report bugs +- Suggest enhancements +- Improve documentation +- Submit pull requests +- Share examples and use-cases + +## Questions and discussions + +If you’re unsure whether something is a bug or a feature request, open an issue and describe: + +- What you expected to happen +- What actually happened +- Steps to reproduce (if applicable) +- Your Dart SDK version (`dart --version`) + +## Filing issues + +When opening an issue, please include: + +- A clear title and description +- Reproduction steps (minimal, if possible) +- Expected vs actual behavior +- Logs, stack traces, or screenshots (if relevant) + +## Development setup + +Prerequisites: + +- Dart SDK (see `pubspec.yaml` for the supported SDK range) + +Common commands: + +- Get dependencies: `dart pub get` +- Format: `dart format .` +- Analyze: `dart analyze` +- Run tests: `dart test` + +Tip: Keep your editor set to “format on save”. + +## Pull requests + +We welcome PRs of all sizes. Small, focused PRs are easiest to review. + +### Before you submit + +- Run `dart format .` +- Run `dart analyze` +- Run `dart test` +- Update documentation if behavior or APIs changed +- Add or update tests for bug fixes and new features +- If you changed public API, update `CHANGELOG.md` + +### PR scope guidelines + +- Keep PRs focused on a single concern (feature, fix, docs) +- Avoid drive-by refactors unless they’re necessary for the change +- Prefer backwards-compatible improvements when possible + +### Review process + +Maintainers will aim to respond, but response time can vary. If you haven’t heard back after a reasonable amount of time, a gentle ping is welcome. + +## Security + +If you discover a security issue, please **do not** open a public issue. + +Instead, report it privately to the maintainer(s)! + +## Licensing of contributions + +Unless stated otherwise, contributions you submit are provided under this project’s license (see [LICENSE](LICENSE)). + +If your organization requires a Contributor License Agreement (CLA) or similar, replace this section with your preferred process. diff --git a/lib/list_or.dart b/lib/list_or.dart index 3edafd5..e9366f5 100644 --- a/lib/list_or.dart +++ b/lib/list_or.dart @@ -111,7 +111,7 @@ class ListOr extends Object with ListMixin { @override String toString() { if (_items.length == 1) { - return _items.firstOrNull.toString(); + return _items.first.toString(); } return _items.toString(); } diff --git a/pubspec.yaml b/pubspec.yaml index 13b47d5..ae9a3f3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,9 @@ name: list_or description: A Dart utility that seamlessly normalizes single values and iterables into a unified, type-safe List. -version: 1.0.0 +version: 1.0.1 + +license: BSD 3-Clause License +homepage: https://git.hadak.org/dart/list_or repository: https://git.hadak.org/dart/list_or issue_tracker: https://git.hadak.org/dart/list_or/issues -- 2.52.0 From 27cee3adfdd92d1fc75f13a147837a7b03627906 Mon Sep 17 00:00:00 2001 From: Hans Kokx Date: Wed, 13 May 2026 14:06:15 +0200 Subject: [PATCH 2/2] Update CHANGELOG for version 1.0.1: clarify `toString` behavior regarding null values Signed-off-by: Hans Kokx --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b126edb..e152db8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 1.0.0 +## 1.0.1 - `toString` no longer tries `firstOrNull` as it should never return null. -- 2.52.0