1 Star 1 Fork 1

weibaohui / sc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

GoDev BuildStatus Go Report Card TODOs codecov

简介

统计源码行数

编译

go build 

安装

go get -u github.com/weibaohui/sc

基本用法

binary user

Usage:
  sc [flags]

Flags:
  -d, --debug         调试
  -h, --help          help for sc
  -p, --path string   扫描路径 (default ".")

docker use

docker -v 挂载待扫描目录到容器里面 sc -p 扫描指定目录

docker run -it --rm -v $(pwd):/code/  weibh/sc  -p /code/ 

输出值

包含了git的用量统计,代码行数的统计

{
  "git": {
    "Branch": 2,
    "Tags": 0,
    "Commit": {
      "git": 56,
      "main": 62
    },
    "AuthorCounts": {
      "weibaohui@chinamobile.com": {
        "Email": "weibaohui@chinamobile.com",
        "Name": "weibh",
        "CommitCount": 61,
        "Addition": 1442,
        "Deletion": 559
      },
      "weibaohui@yeah.net": {
        "Email": "weibaohui@yeah.net",
        "Name": "weibaohui",
        "CommitCount": 163,
        "Addition": 9638,
        "Deletion": 7235
      }
    }
  },
  "source": {
    "FileTypeCounter": {
      "": {
        "Code": 26,
        "Blank": 8,
        "Comment": 0
      },
      ".go": {
        "Code": 2166,
        "Blank": 338,
        "Comment": 0
      },
      ".log": {
        "Code": 1,
        "Blank": 1,
        "Comment": 0
      },
      ".md": {
        "Code": 64,
        "Blank": 17,
        "Comment": 0
      },
      ".mod": {
        "Code": 8,
        "Blank": 4,
        "Comment": 0
      },
      ".sum": {
        "Code": 421,
        "Blank": 1,
        "Comment": 0
      },
      "Sum": {
        "Code": 2686,
        "Blank": 369,
        "Comment": 0
      }
    }
  }
}

说明

默认排除了隐藏文件及文件夹 使用魔法数识别二进制文件并排除

todo

  • docker √
  • git ing

Thanks

感谢 JetBrains 公司 为本开源项目提供的免费正版 Intellij GoLand 的 License 支持。

MIT License Copyright (c) 2021 weibaohui Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

代码行数统计 以及git信息统计 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/weibaohui/sc.git
git@gitee.com:weibaohui/sc.git
weibaohui
sc
sc
main

搜索帮助