The No-Cyrillic Linter validates that source code files don't contain cyrillic (Russian) characters. This linter helps maintain code consistency, prevents accidental language mixing in technical files, and ensures that code remains accessible to international developers who may not read cyrillic scripts.
Source code, configuration files, and technical documentation should use English for variable names, comments, keys, and values. The linter automatically scans YAML, JSON, and Go files to detect and report cyrillic characters.
| Rule | Description | Configurable | Default |
|---|---|---|---|
| files | Validates source files don't contain cyrillic characters | ✅ | enabled |
"Configurable" means that this rule can be configured using the .dmtlint.yaml file, including customizing the rule's parameters and/or disabling the rule.
Purpose: Ensures source code files remain cyrillic-free to maintain international accessibility, code consistency, and best practices. Cyrillic characters in code can cause issues with tooling, make code reviews difficult for non-Russian speakers, and violate coding standards.
Description:
The linter scans all source code files (YAML, YML, JSON, Go) and checks for cyrillic characters (А-Я, а-я, Ё, ё). When detected, it provides visual indicators showing exactly where the problematic characters appear.
What it checks:
- Scans files with extensions:
.yaml,.yml,.json,.go - Detects cyrillic characters (А-Я, а-я, Ё, ё) in file content
- Reports line-by-line occurrences with visual pointers
- Provides exact character positions for easy identification
Automatically Skipped:
The linter intelligently skips files where cyrillic is expected or acceptable:
-
Russian documentation: Files matching patterns:
doc-ru-*.yamlordoc-ru-*.yml- Russian documentation files*.ru.yaml,*.ru.yml,*.ru.json,*.ru.md,*.ru.html- Russian localized files (e.g.CHANGELOG/v0.3.21.ru.yml)*_RU.md- Russian markdown files*_ru.html- Russian HTML files- Files in
docs/site/ordocs/documentation/ - Files in
tools/spelling/
-
Conversion descriptions:
openapi/conversions/*.yaml- Conversion descriptions include Russian translations
-
Module definitions:
module.yaml- Contains Russian descriptions and labelsru.*- Files prefixed withru.(e.g.ru.meta.deckhouse.io/description) carrying Russian metadata
-
Internationalization:
- Files in
/i18n/directories - Translation files
- Files in
-
Linter itself:
no_cyrillic.goandno_cyrillic_test.go- The linter's own code
Why it matters:
- International Collaboration: Code with cyrillic characters is inaccessible to developers who don't read Russian
- Tooling Compatibility: Some development tools and CI/CD systems have issues with non-ASCII characters
- Code Review: Mixed-language code makes reviews harder and error-prone
- Best Practices: Industry standards require English for code
- Search and Indexing: Search tools may not properly index cyrillic characters
Examples:
❌ Incorrect - Cyrillic in YAML configuration:
# config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: my-config
data:
# Настройки приложения
app_name: "my-app"
логирование: "enabled" # Cyrillic key
description: "Описание модуля" # Cyrillic valueError:
Error: has cyrillic letters
File: config.yaml
Value:
# Настройки приложения
^^^^^^^^^^
логирование: "enabled"
^^^^^^^^^^^^
description: "Описание модуля"
^^^^^^^^^^^^^^^
❌ Incorrect - Cyrillic in Go code:
// module.go
package main
// Инициализация модуля
func initialize() {
// Загрузка конфигурации
config := loadConfig()
имяМодуля := "my-module" // Cyrillic variable name
}Error:
Error: has cyrillic letters
File: module.go
Value:
// Инициализация модуля
^^^^^^^^^^^^^^^
// Загрузка конфигурации
^^^^^^^^
имяМодуля := "my-module"
^^^^^^^^^
❌ Incorrect - Cyrillic in JSON:
{
"name": "my-module",
"описание": "Module description",
"version": "1.0.0",
"настройки": {
"enabled": true
}
}Error:
Error: has cyrillic letters
File: config.json
Value:
"описание": "Module description",
^^^^^^^^
"настройки": {
^^^^^^^^^
✅ Correct - English-only YAML:
# config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: my-config
data:
# Application settings
app_name: "my-app"
logging: "enabled"
description: "Module description"✅ Correct - English-only Go code:
// module.go
package main
// Initialize module
func initialize() {
// Load configuration
config := loadConfig()
moduleName := "my-module"
}✅ Correct - English-only JSON:
{
"name": "my-module",
"description": "Module description",
"version": "1.0.0",
"settings": {
"enabled": true
}
}✅ Correct - Cyrillic in allowed files:
# module.yaml (automatically skipped)
name: my-module
description: Module description
descriptionRu: Описание модуля # Cyrillic allowed here<!-- README_RU.md (automatically skipped) -->
# Мой Модуль
Это описание модуля на русском языке.# openapi/conversions/v2.yaml (automatically skipped)
version: 2
description:
en: "Migrated settings"
ru: "Перенесены настройки" # Cyrillic allowed in conversionsVisual Error Format:
The linter provides precise character-level indicators to help you locate cyrillic characters:
Line content: Check the документация for details
Visual pointer: ^^^^^^^^^^^^
--------------^^^^^^^^^^^^^---------
Each ^ points to a cyrillic character, making it easy to find and replace them.
Configuration:
# .dmtlint.yaml
linters-settings:
no-cyrillic:
impact: error # error | warning | info | ignoredTo exclude specific files:
# .dmtlint.yaml
linters-settings:
no-cyrillic:
exclude-rules:
files:
- path/to/legacy-file.go
- config/old-config.yamlTo exclude entire directories:
# .dmtlint.yaml
linters-settings:
no-cyrillic:
exclude-rules:
directories:
- vendor/
- third-party/
- legacy-code/Combined example:
# .dmtlint.yaml
linters-settings:
no-cyrillic:
impact: error
exclude-rules:
files:
- images/legacy/script.sh
- hooks/migration.go
directories:
- vendor/
- third-party/russian-library/The No-Cyrillic linter can be configured at the module level with path-based exclusions.
Configure the overall impact level for the no-cyrillic linter:
# .dmtlint.yaml
linters-settings:
no-cyrillic:
impact: error # Options: error, warning, info, ignoredImpact levels:
error: Violations fail the validation and return a non-zero exit codewarning: Violations are reported but don't fail the validationinfo: Violations are reported as informational messagesignored: The linter is completely disabled
Exclude specific files from cyrillic checking:
# .dmtlint.yaml
linters-settings:
no-cyrillic:
exclude-rules:
files:
- path/to/file.go
- path/to/config.yaml
- scripts/legacy-script.shPattern matching:
- Paths are relative to the module root
- Exact file path matching
- Supports any file extension
Exclude entire directories from cyrillic checking:
# .dmtlint.yaml
linters-settings:
no-cyrillic:
exclude-rules:
directories:
- vendor/
- third-party/
- legacy/
- external/russian-lib/Pattern matching:
- Paths are relative to the module root
- Directory prefix matching
- All files within excluded directories are skipped
# .dmtlint.yaml
linters-settings:
no-cyrillic:
# Global impact level
impact: error
# Exclusion rules
exclude-rules:
# Specific files to exclude
files:
- images/legacy/old-script.sh
- hooks/migration/convert.go
- templates/legacy-template.yaml
# Directories to exclude
directories:
- vendor/
- third-party/
- legacy-code/
- external/russian-library/
- tools/migration/You can also place a .dmtlint.yaml configuration file directly in your module directory:
# modules/my-module/.dmtlint.yaml
linters-settings:
no-cyrillic:
impact: warning # More lenient for this specific module
exclude-rules:
files:
- hooks/legacy-hook.go
directories:
- third-party/