You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/using-gitbase/functions.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,6 +169,26 @@ Also, if you want to retrieve values from a non common property, you can pass it
169
169
170
170
> uast_extract(nodes_column, 'some-property')
171
171
172
+
## How to use `loc`
173
+
174
+
`loc` will return statistics about the lines of code in a file, such as the code lines, comment lines, etc.
175
+
176
+
It requires a file path and a file content.
177
+
178
+
> loc(file_path, blob_content)
179
+
180
+
The result of this function is a JSON document with the following shape:
181
+
182
+
```
183
+
{
184
+
"Code": code lines,
185
+
"Comment": comment lines,
186
+
"Blank": blank lines,
187
+
"Name": file name,
188
+
"Lang": language
189
+
}
190
+
```
191
+
172
192
## How to use `commit_file_stats`
173
193
174
194
`commit_file_stats` will return statistics about the line changes in all files in the given range of commits classifying them in 4 categories: code, comments, blank lines and other.
0 commit comments