I have a Python file that renders into an example within the documentation of a project. Its inline comments support Markdown style, see:
# # Computing the area of a circle
#
# Use the formula: $A = \pi r^2$
#
# The following function implements previous formula:
def compute_circle_area(circle_radius: float) -> float:
"""Compute the area of a circle from its radius.
Parameters
----------
circle_radius : float
Radius of the circle
Returns
-------
float
Area of the circle
"""
return 3.14 * circle_radius ** 2
# Use previous function as follows:
circle_radius = 1
area = compute_circle_area(circle_radius)
print(f"{area = :.2f}")
Given the following .vale.ini file:
# Core settings
# =============
# Location of our `styles`
StylesPath = "styles"
# The options are `suggestion`, `warning`, or `error` (defaults to “warning”).
MinAlertLevel = warning
# By default, `code` and `tt` are ignored.
IgnoredScopes = code, tt
# By default, `script`, `style`, `pre`, and `figure` are ignored.
SkippedScopes = script, style, pre, figure
# WordTemplate specifies what Vale will consider to be an individual word.
WordTemplate = \b(?:%s)\b
# List of Packages to be used for our guidelines
Packages = Google
# Define the Ansys vocabulary
Vocab = ANSYS
[formats]
# Python + Markdown
py = md
[*.{py,md,rst}]
IgnoredScopes = code, tt
# Apply the following styles
BasedOnStyles = Vale, Google
Vale.Terms = NO
# Ignore inline LaTeX equations
TokenIgnores = (\$+[^\n$]+\$+)
# Ignore Python code blocks (not working despite being a valid regex)
BlockIgnores = (?s) """([^"]*)"""
Check for existing issues
Environment
OS information
Install method
Vale version
Describe the bug / provide steps to reproduce it
Background
I have a Python file that renders into an example within the documentation of a project. Its inline comments support Markdown style, see:
Given the following
.vale.ini
file:This issue seems similar to the one in https://github.com/errata-ai/vale/issues/736