Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if new plugin's package_name is PEP 8 compliant #33

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

Xpirix
Copy link
Collaborator

@Xpirix Xpirix commented Nov 15, 2024

Fix for qgis/QGIS-Django#475

Transfered from qgis/QGIS-Django#486

Changes summary

  • Update the validator for new plugin upload: raise an error if the plugin's directory (package_name) contains special characters:
    • Allowed characters: Lowercase letters (a to z), digits (0 to 9), and underscores (_).
    • First character: Must be a lowercase letter or an underscore.
    • Disallowed characters: Any special characters (e.g., -, @, #, $, etc.), uppercase letters, and whitespace.
  • Update the unit tests

Uploading a new plugin with an invalid directory name will generate the following error:

image

Suggestion

  • Ensure that the documentation (PyQGIS Cookbook) includes information about PEP8 & Python/QGIS guidelines compliance

qgis-app/plugins/validator.py Outdated Show resolved Hide resolved
@Xpirix Xpirix merged commit 19049e2 into qgis:master Nov 15, 2024
2 checks passed
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.

2 participants