Skip to main content

A tool to ensure that code adheres to Prune's coding standards.

Project description

Prune's Norminette

What is it for?

The norminette automatically checks the organization of files in a Django project as well as code rules. This allows for the same code standard between projects and makes it easier to navigate.

Prerequisites

  • To be installed on a Prune Django project that uses poetry or UV
  • SSH access to the project: verify that you have SSH access to the Gitlab project of the norminette

UV project

Installation

In pyproject.toml, add in the dependencies = [] or dev[] section :

dependencies = [
"norminette @ git+ssh://git@gitlab.com/bastien_arnout/norminette.git",
]

To synchronize the results, run the following command in the console:

uv sync

Ou

uv lock

Running the norminette

To run the package, simply enter in the console :

norminette

Updating the norminette

Don't hesitate to run uv sync --upgrade sometimes, the norminette evolves with time and our practices!

Poetry project

Installation

In pyproject.toml, add in the [tool.poetry.group.dev.dependencies] section :

[tool.poetry.group.dev.dependencies]
norminette = { git = "git@gitlab.com:bastien_arnout/norminette.git" }

Then, run the following command :

poetry update norminette

Running the norminette

poetry run norminette

Updating the norminette

Don't hesitate to run poetry update norminette sometimes, the norminette evolves with time and our practices!

Project architecture at Prune

To access the documentation, please go to the link where you can find documentation in English and French.

Documentation

If you want to download it directly, here is the link :

Download

Rules

Id Name Description Tags
01 name_view_function Verify that the name of rendering functions for views ends with '_view'. python_files files_content
02 verify_pages_folder Verify if page.html files are inside the pages/ folder and ensure files in pages/ are named page (except in components, sections, and layouts folders). web_files architecture
03 verify_structure_templates_static Verify that the static/ and templates/ folders contain only one subfolder named after the app. architecture
04 double_line Remove double empty lines in HTML, JS, and CSS files. format files_content web_files
05 space_tag Normalize spaces in Django tags (with exactly one space between the tag and its content). format web_files files_content
06 component_layout_emplacement Verify that layout, component, and section files are correctly placed based on their include references. web_files architecture
07 include_svg Ensure that SVG includes use absolute paths. web_files files_content
08 svg Verify that SVG files are inside the svg/ folder and use the .html extension. web_files architecture

Tags

  • web_files : HTML, JS, and CSS files.
  • python_files : Python files with .py extension.
  • architecture : Checks folder and file placement consistency.
  • format : Directly modifies file formatting.
  • files_content : Inspects file contents.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

norminette_prune-0.1.1.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

norminette_prune-0.1.1-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file norminette_prune-0.1.1.tar.gz.

File metadata

  • Download URL: norminette_prune-0.1.1.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.31

File hashes

Hashes for norminette_prune-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a41792058056d7c5ff99b9bca4735598e9b2d8db5f82daf1f76c3a2ec8c69ee9
MD5 f1065e1b30e41e4c3ee3e366d1d39627
BLAKE2b-256 0dde522748dbbdf44c6dcc300ac32839b4c9769f7196c0681a3e7b88635dc509

See more details on using hashes here.

File details

Details for the file norminette_prune-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for norminette_prune-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4106d448994c5a3c3b68bea6dbb1b026716072b57ae2b6c425fc290b8a8f0421
MD5 e39c7e23d95f0e48c00e94ff8e47bcf0
BLAKE2b-256 7e044bf52f5080fb313a1be7761648ac28ffbfb49a5436e6120dc72b08da0dd5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page