Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Python raw docstrings
Sometimes, in Python, a docstring will be a raw (`r"..."`) string, as opposed to a regular (`"..."`) string (I've seen this when a docstring needs to escape things in funny ways for sphinx). This commit adds two entries to the `Python.quote` section of `languages.json` (and the corresponding update to `constants.go`) for recognizing these raw docstrings as docs rather than code. For example, without this commit, for the file ```python r"""Welcome to foo.py! Sometimes I escape :class:`thing`\s funny when Sphinx is involved. """ def hello(): pass ``` `scc` reports ``` ─────────────────────────────────────────────────────────────────────────────── Language Files Lines Blanks Comments Code Complexity ─────────────────────────────────────────────────────────────────────────────── Python 1 6 0 0 6 0 ─────────────────────────────────────────────────────────────────────────────── Total 1 6 0 0 6 0 ─────────────────────────────────────────────────────────────────────────────── Estimated Cost to Develop (organic) $125 Estimated Schedule Effort (organic) 0.45 months Estimated People Required (organic) 0.02 ─────────────────────────────────────────────────────────────────────────────── Processed 117 bytes, 0.000 megabytes (SI) ─────────────────────────────────────────────────────────────────────────────── ``` But with this commit, reports ``` ─────────────────────────────────────────────────────────────────────────────── Language Files Lines Blanks Comments Code Complexity ─────────────────────────────────────────────────────────────────────────────── Python 1 6 1 3 2 0 ─────────────────────────────────────────────────────────────────────────────── Total 1 6 1 3 2 0 ─────────────────────────────────────────────────────────────────────────────── Estimated Cost to Develop (organic) $39 Estimated Schedule Effort (organic) 0.29 months Estimated People Required (organic) 0.01 ─────────────────────────────────────────────────────────────────────────────── Processed 117 bytes, 0.000 megabytes (SI) ─────────────────────────────────────────────────────────────────────────────── ``` Thanks for your consideration!
- Loading branch information