lint: Ensure non-dev templates entrypoint name doesn't start with dev.

Only development-related templates entrypoint name
should start with `dev`.
This commit is contained in:
Riken Shah
2021-04-16 15:48:20 +00:00
committed by Tim Abbott
parent 1d9417f9a1
commit c3601d7e3e
4 changed files with 9 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
{% extends "zerver/base.html" %} {% extends "zerver/base.html" %}
{% set entrypoint = "email-log" %} {% set entrypoint = "dev-email-log" %}
{% block content %} {% block content %}
<div class="container"> <div class="container">
<div style="position: fixed"> <div style="position: fixed">

View File

@@ -1,5 +1,5 @@
{% extends "zerver/portico.html" %} {% extends "zerver/portico.html" %}
{% set entrypoint = "integrations-dev-panel" %} {% set entrypoint = "dev-integrations-panel" %}
{% block customhead %} {% block customhead %}

View File

@@ -754,6 +754,11 @@ jinja2_rules = RuleList(
"pattern": r"{{ _(.+) }}[\.\?!]", "pattern": r"{{ _(.+) }}[\.\?!]",
"description": "Period should be part of the translatable string.", "description": "Period should be part of the translatable string.",
}, },
{
"pattern": r'{% set entrypoint = "dev-',
"exclude": {"templates/zerver/development/"},
"description": "Development entrypoints (dev-) must not be imported in production.",
},
], ],
) )

View File

@@ -90,14 +90,14 @@
"dev-login": ["./static/js/bundles/portico", "./static/js/portico/dev-login"], "dev-login": ["./static/js/bundles/portico", "./static/js/portico/dev-login"],
"desktop-login": ["./static/js/bundles/portico", "./static/js/portico/desktop-login"], "desktop-login": ["./static/js/bundles/portico", "./static/js/portico/desktop-login"],
"desktop-redirect": ["./static/js/bundles/portico", "./static/js/portico/desktop-redirect"], "desktop-redirect": ["./static/js/bundles/portico", "./static/js/portico/desktop-redirect"],
"integrations-dev-panel": [ "dev-integrations-panel": [
"./static/js/bundles/portico", "./static/js/bundles/portico",
"./static/js/portico/integrations_dev_panel", "./static/js/portico/integrations_dev_panel",
"./static/styles/portico/integrations_dev_panel.css", "./static/styles/portico/integrations_dev_panel.css",
"./static/js/reload_state", "./static/js/reload_state",
"./static/js/channel" "./static/js/channel"
], ],
"email-log": [ "dev-email-log": [
"./static/js/bundles/common", "./static/js/bundles/common",
"./static/js/portico/email_log", "./static/js/portico/email_log",
"./static/js/reload_state", "./static/js/reload_state",