Skip to content

Conversation

@meatharvester
Copy link
Collaborator

@meatharvester meatharvester commented Aug 3, 2025

Description

Updates rolecount.py to be more reflective of our current roles (also added some comments)

Guidelines

  • My code follows the style guidelines of this project (formatted with Ruff)

  • I have performed a self-review of my own code

  • I have commented my code, particularly in hard-to-understand areas

  • I have made corresponding changes to the documentation if needed

  • My changes generate no new warnings

  • I have tested this change

  • Any dependent changes have been merged and published in downstream modules

  • I have added all appropriate labels to this PR

  • I have followed all of these guidelines.

Additional Information

This will need to be tested in the main server before it can be merged

Summary by Sourcery

Update rolecount.py to reflect current guild roles and streamline role categories

Enhancements:

  • Refresh role ID mappings across DE/WM, distro, language, vanity, and editor categories to replace outdated roles with current ones
  • Add new roles including grey_question (Other DE/WM), headphones (vanity), sh (Shell Script), cplusplus, r, Cursor, and Zed
  • Rename misc role category to editor and update command choices accordingly
  • Add inline comments and TODOs to clarify role definitions and future improvements

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Aug 3, 2025

Reviewer's Guide

Updated rolecount.py to align with current server roles by overhauling the DE/WM, distro, language, and editor role lists, renaming variables and menu options, and inserting new roles and comments.

Class diagram for updated role category variables in rolecount.py

classDiagram
    class RoleCountCog {
        - des_ids: list
        - distro_ids: list
        - lang_ids: list
        - editor_ids: list
        - vanity_ids: list
        - role_categories: dict
        __init__(bot: Tux)
    }

    RoleCountCog : des_ids --> "DE/WM roles"
    RoleCountCog : distro_ids --> "Distro roles"
    RoleCountCog : lang_ids --> "Language roles"
    RoleCountCog : editor_ids --> "Editor roles"
    RoleCountCog : vanity_ids --> "Vanity roles"
    RoleCountCog : role_categories --> "Category mapping"
Loading

Class diagram for role category menu option changes

classDiagram
    class RoleCategoryMenu {
        + Distro: ds
        + Language: lg
        + DE/WM: de
        + Editors: edit
        + Vanity: vanity
    }
Loading

File-Level Changes

Change Details Files
DE/WM role list revised
  • Removed outdated roles _berry, _leftwm, _enlightenment
  • Added new roles _cosmic, _niri, grey_question
tux/cogs/guild/rolecount.py
Distro roles consolidated
  • Deleted numerous specific distros (openbsd, artix, garuda, solus, etc.)
  • Introduced generic base roles _arch, _ubuntu, _fedora with comments
tux/cogs/guild/rolecount.py
Language roles renamed and extended
  • Renamed _bash to _sh and updated cplusplus ID
  • Inserted comments for grouping (Shell Script, HTML/CSS, JS/TS)
  • Added new language role _r
tux/cogs/guild/rolecount.py
Misc category renamed to editor
  • Renamed misc_ids variable to editor_ids
  • Updated roles dict key and command choice from misc to edit and label to Editors
tux/cogs/guild/rolecount.py
Additional role and comment additions
  • Added new vanity role headphones
  • Inserted TODO for Shell Roles and retained existing TODO
tux/cogs/guild/rolecount.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @cherryl1k - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `tux/cogs/guild/rolecount.py:133` </location>
<code_context>
     [1187804435578093690, "_ed"],
-    [1189236454153527367, "_gecko"],
-    [1189236400571301958, "_chromium"],
+    [1392616344075243570, "_Cursor"],
+    [1367199970587050035, "_Zed"],
 ]
</code_context>

<issue_to_address>
Role name '_Cursor' uses uppercase; consider consistency.

Rename '_Cursor' to '_cursor' for consistency with other role names and to prevent case sensitivity issues.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

[1187804435578093690, "_ed"],
[1189236454153527367, "_gecko"],
[1189236400571301958, "_chromium"],
[1392616344075243570, "_Cursor"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: Role name '_Cursor' uses uppercase; consider consistency.

Rename '_Cursor' to '_cursor' for consistency with other role names and to prevent case sensitivity issues.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 3, 2025

Deploying tux with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9ea2c21
Status: ✅  Deploy successful!
Preview URL: https://0cf7cac4.tux-afh.pages.dev
Branch Preview URL: https://rolecount-update.tux-afh.pages.dev

View logs

@electron271 electron271 changed the title fix: updated rolecount.py to be more refelcted of our current roles fix: updated rolecount.py to be more reflected of our current roles Aug 3, 2025
@codecov
Copy link

codecov bot commented Aug 4, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 9.63%. Comparing base (85084b5) to head (9ea2c21).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
tux/cogs/guild/rolecount.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #1002      +/-   ##
========================================
+ Coverage   9.57%   9.63%   +0.05%     
========================================
  Files        123     123              
  Lines      10415   10415              
  Branches    1279    1279              
========================================
+ Hits         997    1003       +6     
+ Misses      9316    9308       -8     
- Partials     102     104       +2     
Flag Coverage Δ *Carryforward flag
database 0.31% <ø> (+<0.01%) ⬆️ Carriedforward from 85084b5
integration 5.85% <0.00%> (ø)
unit 6.30% <0.00%> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Components Coverage Δ
Core Bot Infrastructure 16.43% <ø> (ø)
Database Layer 0.00% <ø> (ø)
Bot Commands & Features 0.00% <0.00%> (ø)
Event & Error Handling ∅ <ø> (∅)
Utilities & Helpers ∅ <ø> (∅)
User Interface Components 0.00% <ø> (ø)
CLI Interface ∅ <ø> (∅)
External Service Wrappers ∅ <ø> (∅)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@electron271 electron271 merged commit c60566c into main Aug 4, 2025
36 checks passed
@electron271 electron271 deleted the rolecount/update branch August 4, 2025 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants