Python bindings for rust-code-analysis, a Rust library to analyze and collect metrics on source code.
Full documentation available here: https://rust-code-analysis-python.readthedocs.org
%pip install rust-code-analysis-python
from rust_code_analysis_python import compute_metrics, remove_comments
# Get code metrics
metrics_result = compute_metrics("example.rs", code_string, unit=True)
# Remove comments from code
code_without_comments = remove_comments("example.c", code_string)
pip install -r dev_requirements.txt
# Must have rust installed (see rustup.rs)
# Run linting, build and test
tox runThis Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.