frslint
Linter for FreeSWITCH XML configuration files. Checks code style, finds common errors, and can auto-fix most issues. Able to run debug mode to follow the evalution steps in your freeswitch to follow where what is happen in your configuration.
About
This project is a hobby project. As I am tasked with maintaining some freeswitch systems and the freeswitch ecosystem was lacking any static analysis / debugging tools. It is not perfect, the code has its faults, not every case is covered yet, but I would like to continue improving this over time. Feel free to submit wishes / bug reports, so this tool can grow into something bigger.
Installation
pip install frslint
Or install from source:
git clone https://github.com/zimmer-yan/frslint
cd frslint
pip install -e .
Usage
Lint (code style)
Check for style issues:
frslint lint /etc/freeswitch/freeswitch.xml
Auto-fix what can be fixed:
frslint lint /etc/freeswitch/freeswitch.xml --fix
Options:
--fix Auto-fix fixable issues
--indent-size N Expected indent size (default: 2)
--max-line-length N Max line length (default: 120)
--max-blank-lines N Max consecutive blank lines (default: 2)
--allow-tabs Allow tabs instead of spaces
-f, --format json Output json formatted
-v, --verbose Verbose output
Analyze (static analysis)
Check for errors like undefined variables, invalid regex, etc:
frslint analyze /etc/freeswitch/freeswitch.xml
Options:
-f, --format json Output json formatted
-v, --verbose Verbose output
Debug
Trace dialplan execution for a given destination number:
frslint debug /etc/freeswitch/freeswitch.xml 1234
frslint debug /etc/freeswitch/freeswitch.xml 1234 -c public
Options:
-n, --network-addr Network address of the caller
-c, --context-name Name of the context to run (default: public)
-v, --verbose Verbose output
What it checks
Lint:
- Trailing whitespace
- Tabs vs spaces
- Indentation depth
- Consecutive blank lines
- Missing newline at EOF
- Line length
- Mixed line endings (CRLF/LF)
Analyze:
- Undefined channel variables
- Invalid regex patterns
- Missing required attributes
- Unknown applications
Exit codes
0- No issues found1- Issues found (or unfixed issues when using--fix)
Metadata
Release files for frslint 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| frslint-0.1.0.tar.gz | 25.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| frslint-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 61.0 kB
Release files / frslint-0.1.0.tar.gz
| Download URL | frslint-0.1.0.tar.gz |
|---|---|
| Size | 25.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2542a02e8c004ad6ad6fbf7c0d0f4e18b197f992c7222cc66c0dfeada66d7bac
|
|
BLAKE2b-256 checksum How to use checksums |
f8c5f87182ea778b833cfdf1e98c24be7877372e3216dda80c592650e7b4ba1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / frslint-0.1.0-py3-none-any.whl
| Download URL | frslint-0.1.0-py3-none-any.whl |
|---|---|
| Size | 35.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
58bdf2c665833531bcf3dbb3f8b5b4f6eb4bad287ddc3e4fdc909c730ccb089a
|
|
BLAKE2b-256 checksum How to use checksums |
9097b00da8994b234cbd2988e75d15a089549c4ff273fd6b9259eebeea444fe8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|