{"id":13764124,"url":"https://github.com/qiniu/checkstyle","last_synced_at":"2025-07-07T13:40:29.081Z","repository":{"id":12882424,"uuid":"15558950","full_name":"qiniu/checkstyle","owner":"qiniu","description":"checkstyle for go","archived":false,"fork":false,"pushed_at":"2021-03-10T02:55:53.000Z","size":43,"stargazers_count":131,"open_issues_count":5,"forks_count":17,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-05T20:18:18.540Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qiniu.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2014-01-01T01:09:27.000Z","updated_at":"2025-04-16T00:22:55.000Z","dependencies_parsed_at":"2022-09-06T10:50:27.571Z","dependency_job_id":null,"html_url":"https://github.com/qiniu/checkstyle","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiniu%2Fcheckstyle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiniu%2Fcheckstyle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiniu%2Fcheckstyle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiniu%2Fcheckstyle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qiniu","download_url":"https://codeload.github.com/qiniu/checkstyle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252569641,"owners_count":21769517,"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":[],"created_at":"2024-08-03T15:01:14.752Z","updated_at":"2025-05-05T20:18:30.214Z","avatar_url":"https://github.com/qiniu.png","language":"Go","funding_links":[],"categories":["相关工具","Code Analysis","Linters","代码分析","相关工具`go相关工具和插件`","代碼分析","Libraries for creating HTTP middlewares"],"sub_categories":["代码分析","Routers","Style and Patterns Checking","Middlewares","路由器","路由"],"readme":"go-checkstyle\n=============\n[![Build Status](https://api.travis-ci.org/qiniu/checkstyle.png?branch=master)](https://travis-ci.org/qiniu/checkstyle)\n\ncheckstyle is a style check tool like java checkstyle. This tool inspired by [java checkstyle](https://github.com/checkstyle/checkstyle), [golint](https://github.com/golang/lint). The style refered to some points in [Go Code Review Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments).\n\n# Install\n  go get github.com/qiniu/checkstyle/gocheckstyle\n\n# Run\n  gocheckstyle -config=.go_style dir1 dir2\n\n# Config \nconfig is json file like the following:\n```\n{\n    \"file_line\": 500,\n    \"func_line\": 50,\n    \"params_num\":4,\n    \"results_num\":3,\n    \"formated\": true,\n    \"pkg_name\": true,\n    \"camel_name\":true,\n    \"ignore\":[\n        \"a/*\",\n        \"b/*/c/*.go\"\n    ],\n    \"fatal\":[\n        \"formated\"\n    ]\n}\n\n```\n\n# Add to makefile\n```\ncheck_go_style:\n\tbash -c \"mkdir -p checkstyle; cd checkstyle \u0026\u0026 export GOPATH=`pwd` \u0026\u0026 go get github.com/qiniu/checkstyle/gocheckstyle\"\n\tcheckstyle/bin/gocheckstyle -config=.go_style dir1 dir2\n\n```\n\n# Integrate with jenkins checkstyle plugin\nexcute in shell\n```\n    mkdir -p checkstyle; cd checkstyle \u0026\u0026 export GOPATH=`pwd` \u0026\u0026 go get github.com/qiniu/checkstyle/gocheckstyle\"\n    checkstyle/bin/gocheckstyle -reporter=xml -config=.go_style dir1 dir2 2\u003egostyle.xml\n```\nthen add postbuild checkstyle file gostyle.xml\n\nRun checkstyle with one or more filenames or directories. The output of this tool is a list of suggestions. If you need to force obey the rule, place it in fatal.\n\n# Checkstyle's difference with other tools\nCheckstyle differs from gofmt. Gofmt reformats Go source code, whereas checkstyle prints out coding style suggestion.\n\nCheckstyle differs from golint. Checkstyle check file line/function line/param number, could be configed by user.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqiniu%2Fcheckstyle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqiniu%2Fcheckstyle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqiniu%2Fcheckstyle/lists"}