[Downloader/Core] Enforce naming conventions for packages, cogs and commands #4634

Closed
opened 2020-11-20 13:51:49 +01:00 by Dav-Git · 5 comments
Dav-Git commented 2020-11-20 13:51:49 +01:00 (Migrated from github.com)

Feature request

To guarantee a smooth user experience and get a consistent behaviour when using Red, all naming conventions from the Cog Creator Guidelines should be enforced.

That means that

  • Cog classes should be TitleCased, using alphabetic characters only.
  • Commands should be lower case, using alphanumeric characters only.
  • Cog modules should be lower case, using alphabetic characters only.

There was previous discussion to this issue here. It was brought up after a conversation with a red user here and here.

The current proposal is to enforce compliance with these guidelines within Red itself.
The option to enforce these guidelines only on approved CCs via QA was discussed but dropped in favor of a unified experience in the long run.

This will break the automatic updating of cogs when running [p]cog update. Users using affected cogs would need to remove and re-add them once they follow the naming conventions.

Select the type of feature you are requesting:

  • Cog
  • Command
  • API functionality

Update: I forgot to add links to the conversations

# Feature request To guarantee a smooth user experience and get a consistent behaviour when using Red, all naming conventions from the [Cog Creator Guidelines](https://docs.discord.red/en/stable/guide_cog_creation.html#guidelines-for-cog-creators) should be enforced. That means that - Cog classes should be TitleCased, using alphabetic characters only. - Commands should be lower case, using alphanumeric characters only. - Cog modules should be lower case, using alphabetic characters only. There was previous discussion to this issue [here](https://discord.com/channels/133049272517001216/718148684629540905/779282174599626754). It was brought up after a conversation with a red user [here](https://discord.com/channels/133049272517001216/133049878837329920/779258254391771136) and [here](https://discord.com/channels/133049272517001216/133081046869737472/779280468821540864). The current proposal is to enforce compliance with these guidelines within Red itself. The option to enforce these guidelines only on approved CCs via QA was discussed but dropped in favor of a unified experience in the long run. This **will break** the automatic updating of cogs when running ``[p]cog update``. Users using affected cogs would need to remove and re-add them once they follow the naming conventions. #### Select the type of feature you are requesting: - [ ] Cog - [ ] Command - [x] API functionality Update: I forgot to add links to the conversations
Drapersniper commented 2020-11-20 13:57:44 +01:00 (Migrated from github.com)

+1 from me on enforcing it at a framework level which will ensure a unified experience.

That said this issue is lacking some additional info.

The discussion summarized on @Twentysix26 and I, agreeing that Enforcing the following on a framework level will be the best experience long term.

Package names can only be loaded if they are lowercase.
Cogs can only be loaded if they are CamelCase.
Commands can only be added if they are lowercase.

Adding these 3 restriction to the framewor will ensure a uniform user experience where all commands, cogs and packages behave in the same manner.

The downsides is reducing the potential namescape for commands, cogs and packages, but given that any variation here will make it for a very confusing user experience, the downside doesn't outweight the positives on this enforcement.

EDIT:

  • I noticed that Dav mention alphanumeric, which is not something i think its a entire requirement here, after all as @Rapptz mentioned I don't think we should enforce latin characters only here.
+1 from me on enforcing it at a framework level which will ensure a unified experience. That said this issue is lacking some additional info. The discussion summarized on @Twentysix26 and I, agreeing that Enforcing the following on a framework level will be the best experience long term. Package names can only be loaded if they are lowercase. Cogs can only be loaded if they are CamelCase. Commands can only be added if they are lowercase. Adding these 3 restriction to the framewor will ensure a uniform user experience where all commands, cogs and packages behave in the same manner. The downsides is reducing the potential namescape for commands, cogs and packages, but given that any variation here will make it for a very confusing user experience, the downside doesn't outweight the positives on this enforcement. EDIT: - I noticed that Dav mention alphanumeric, which is not something i think its a entire requirement here, after all as @Rapptz mentioned I don't think we should enforce latin characters only here.
Rapptz commented 2020-11-20 14:02:22 +01:00 (Migrated from github.com)

I have no stake in this but I am strictly opposed at the Anglocentricism in requiring identifiers and names to be in English. Python and the library both allow other language identifiers for users of languages other than English, including those in the CJK space.

I have no stake in this but I am strictly opposed at the Anglocentricism in requiring identifiers and names to be in English. Python and the library both allow other language identifiers for users of languages other than English, including those in the CJK space.
TrustyJAID commented 2020-11-20 14:25:38 +01:00 (Migrated from github.com)

I am going to sound off here that I am not in favor of enforcing these within Red itself. It restricts cog creator freedom too much. If a cog creator chooses to go against convention on their own users may request from the author themselves to change to make things an easier experience for them. However, it's entirely on the author of the cogs to support user experience and not something Red should deal with. Red deals with Red, cog creators deal with their own cogs and the user experience on them.

I am going to sound off here that I am not in favor of enforcing these within Red itself. It restricts cog creator freedom too much. If a cog creator chooses to go against convention on their own users may request from the author themselves to change to make things an easier experience for them. However, it's entirely on the author of the cogs to support user experience and not something Red should deal with. Red deals with Red, cog creators deal with their own cogs and the user experience on them.
Flame442 commented 2020-11-20 20:09:06 +01:00 (Migrated from github.com)

To guarantee a smooth user experience and get a consistent behaviour when using Red, all naming conventions from the Cog Creator Guidelines should be enforced.
...
The current proposal is to enforce compliance with these guidelines within Red itself.

I would just like to chime in here, Guidelines For Cog Creators was never a strictly enforced document, it was just meant as a starting point for CCs to write good code for their review.

What will be enforced is the new Cog Creator Policy (and the docs entry I am going to PR probably later this weekend), however that does not have any mention of the casing of cogs or commands.

I am not for enforcing this via QA, as QA's job for CC apps is being focused around ensuring that code is safe and functional, not that it follows convention or has good UX.

As for enforcing this in downloader/core, I don't think it is worth the breaking change and explaining to users/CCs why this is happening just for some better UX the CC could decided to do in the first place.

> To guarantee a smooth user experience and get a consistent behaviour when using Red, all naming conventions from the Cog Creator Guidelines should be enforced. ... The current proposal is to enforce compliance with these guidelines within Red itself. I would just like to chime in here, `Guidelines For Cog Creators` was never a strictly enforced document, it was just meant as a starting point for CCs to write good code for their review. What *will* be enforced is the new [Cog Creator Policy](https://github.com/Cog-Creators/Red-Policies/blob/master/policies/accepted/10.md) (and the docs entry I am going to PR probably later this weekend), however that does **not** have any mention of the casing of cogs or commands. I am not for enforcing this via QA, as QA's job for CC apps is being focused around ensuring that code is *safe* and *functional*, not that it follows convention or has good UX. As for enforcing this in downloader/core, I don't think it is worth the breaking change and explaining to users/CCs why this is happening just for some better UX the CC could decided to do in the first place.
Jackenmen commented 2021-06-25 18:34:13 +02:00 (Migrated from github.com)

Thanks for making the issue but based on the previous maintainer comments here, this is something that we are not interested in pursuing.

Thanks for making the issue but based on the previous maintainer comments here, this is something that we are not interested in pursuing.
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#4634
No description provided.