{"id":16571541,"url":"https://github.com/hrbrmstr/cloc","last_synced_at":"2025-03-21T12:30:57.561Z","repository":{"id":51071753,"uuid":"38405179","full_name":"hrbrmstr/cloc","owner":"hrbrmstr","description":"🔢 R package to the perl cloc script (which counts blank lines, comment lines, and physical lines of source code in source files/trees/archives)","archived":false,"fork":false,"pushed_at":"2023-04-23T13:12:18.000Z","size":9001,"stargazers_count":59,"open_issues_count":7,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T01:11:17.585Z","etag":null,"topics":["cloc","count-lines-of-code","r","rstats"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hrbrmstr.png","metadata":{"files":{"readme":"README.Qmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-07-02T01:52:30.000Z","updated_at":"2024-11-07T11:24:21.000Z","dependencies_parsed_at":"2022-09-01T12:11:28.543Z","dependency_job_id":"d4dbc12d-1605-4dc6-8f0b-fa4df8e5dff0","html_url":"https://github.com/hrbrmstr/cloc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fcloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fcloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fcloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fcloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrbrmstr","download_url":"https://codeload.github.com/hrbrmstr/cloc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244799234,"owners_count":20512212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloc","count-lines-of-code","r","rstats"],"created_at":"2024-10-11T21:24:22.487Z","updated_at":"2025-03-21T12:30:57.188Z","avatar_url":"https://github.com/hrbrmstr.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\nformat: gfm\neditor_options: \n  chunk_output_type: console\n---\n```{r pkg-knitr-opts, include=FALSE}\nhrbrpkghelpr::global_opts()\n```\n\n```{r badges, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::stinking_badges()\n```\n\n```{r description, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::yank_title_and_description()\n```\n\n## What's Inside The Tin\n\nThe following functions are implemented:\n\n```{r ingredients, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::describe_ingredients()\n```\n\n## Installation\n\n```{r install-ex, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::install_block()\n```\n\n## Usage\n\n```{r lib-ex}\nlibrary(cloc)\nlibrary(tibble) # for printing\n\n# current version\npackageVersion(\"cloc\")\n\n```\n\nBasic usage\n\n```{r cloc-basic, message=FALSE, warning=FALSE, error=FALSE}\n# by dir\ncloc(system.file(\"extdata\", package=\"cloc\"))\n\n# by file\ncloc(system.file(\"extdata\", \"qrencoder.cpp\", package=\"cloc\"))\n\n# from a url\ncloc(\"https://rud.is/dl/cloc-1.74.tar.gz\")\n```\n\nCustom CRAN package counter:\n\n```{r cloc-cran, message=FALSE, warning=FALSE, error=FALSE}\ncloc_cran(c(\"archdata\", \"hrbrthemes\", \"iptools\", \"dplyr\"))\n```\n\ngit tree \n\n```{r cloc-git-tree, message=FALSE, warning=FALSE, error=FALSE, eval=FALSE}\ncloc_git(\"~/packages/cloc\")\n##   source language file_count file_count_pct   loc      loc_pct blank_lines blank_line_pct comment_lines comment_line_pct\n## 1   cloc     Perl          1      0.1111111 10059 0.9867569158         787    0.910879630          1292     0.9570370370\n## 2   cloc Markdown          2      0.2222222    60 0.0058858152          31    0.035879630             0     0.0000000000\n## 3   cloc        R          4      0.4444444    52 0.0051010398          22    0.025462963            25     0.0185185185\n## 4   cloc      Rmd          1      0.1111111    13 0.0012752600          21    0.024305556            32     0.0237037037\n## 5   cloc     YAML          1      0.1111111    10 0.0009809692           3    0.003472222             1     0.0007407407\n```\n\ngit tree (with specific commit)\n\n```{r cloc-git-tree-commit, message=FALSE, warning=FALSE, error=FALSE, eval=FALSE}\ncloc_git(\"~/packages/cloc\", \"3643cd09d4b951b1b35d32dffe35985dfe7756c4\")\n##   source language file_count file_count_pct   loc      loc_pct blank_lines blank_line_pct comment_lines comment_line_pct\n## 1   cloc     Perl          1      0.1111111 10059 0.9867569158         787    0.910879630          1292     0.9570370370\n## 2   cloc Markdown          2      0.2222222    60 0.0058858152          31    0.035879630             0     0.0000000000\n## 3   cloc        R          4      0.4444444    52 0.0051010398          22    0.025462963            25     0.0185185185\n## 4   cloc      Rmd          1      0.1111111    13 0.0012752600          21    0.024305556            32     0.0237037037\n## 5   cloc     YAML          1      0.1111111    10 0.0009809692           3    0.003472222             1     0.0007407407\n```\n\nremote git tree\n\n```{r cloc-remote-git-tree, message=FALSE, warning=FALSE, error=FALSE}\ncloc_git(\"https://github.com/maelle/convertagd.git\")\n```\n\nDetailed results by file\n\n```{r cloc-detailed, message=FALSE, warning=FALSE, error=FALSE}\n# whole dir\nstr(cloc_by_file(system.file(\"extdata\", package=\"cloc\")))\n\n# single file\nstr(cloc_by_file(system.file(\"extdata\", \"qrencoder.cpp\", package=\"cloc\")))\n```\n\nRecognized languages\n\n```{r cloc-langs, message=FALSE, warning=FALSE, error=FALSE}\ncloc_recognized_languages()\n```\n\nStrip comments and whitespace from individual source files\n\n```{r cloc-strip, message=FALSE, warning=FALSE, error=FALSE}\ncat(\n  cloc_remove_comments(\"https://raw.githubusercontent.com/maelle/convertagd/master/README.Rmd\")\n)\n```\n\n## cloc Metrics\n\n```{r cloc-metrics, echo=FALSE}\ncloc_pkg_md()\n```\n\n## Code of Conduct\n\nPlease note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrbrmstr%2Fcloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrbrmstr%2Fcloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrbrmstr%2Fcloc/lists"}