Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support linting remote GitHub projects via the API #16

Merged
merged 9 commits into from
Dec 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 33 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,32 @@ show the full gamut of suggestions:
~/projects/dream
❯ flint
[ERROR] README not found
[FIXME] Every project begins with a README. http://bit.ly/1dqUYQF
[ERROR] License file not found
[FIXME] Add a license to protect yourself and your users. http://choosealicense.com/
[WARNING] Contributing guide not found
[FIXME] Add a CONTRIBUTING guide for potential contributors. http://git.io/z-TiGg
[INFO] Every project begins with a README. http://bit.ly/1dqUYQF
[ERROR] CONTRIBUTING guide not found
[INFO] Add a guide for potential contributors. http://git.io/z-TiGg
[ERROR] LICENSE not found
[INFO] Add a license to protect yourself and your users. http://choosealicense.com/
[WARNING] Bootstrap script not found
[FIXME] A bootstrap script makes setup a snap. http://bit.ly/JZjVL6
[CRITICAL] Some critical problems found. Please fix right away!
[INFO] A bootstrap script makes setup a snap. http://bit.ly/JZjVL6
[WARNING] Test script not found
[INFO] Make it easy to run the test suite regardless of project type. http://bit.ly/JZjVL6
[CRITICAL] Some critical problems found.
```

You can also run this in older projects which were created by lazy you, or by
younger, less wise you.

If you want to check a remote GitHub repository, you can now do so without
cloning:

```sh
❯ flint --github pengwynn/dotfiles
[ERROR] CONTRIBUTING guide not found
[INFO] Add a guide for potential contributors. http://git.io/z-TiGg
[WARNING] Test script not found
[INFO] Make it easy to run the test suite regardless of project type. http://bit.ly/JZjVL6
[CRITICAL] Some critical problems found.
```
Passing the `-h` flag will show full usage options:

```
Expand All @@ -50,20 +63,23 @@ USAGE:
flint [global options] command [command options] [arguments...]

VERSION:
0.0.2
0.0.4

COMMANDS:
help, h Shows a list of commands or help for one command
help, h Shows a list of commands or help for one command

GLOBAL OPTIONS:
--skip-readme skip check for README
--skip-contributing skip check for contributing guide
--skip-license skip check for license
--skip-bootstrap skip check for bootstrap script
--skip-test skip check for test script
--skip-scripts skip check for all scripts
--version, -v print the version
--help, -h show help
--skip-readme skip check for README
--skip-contributing skip check for contributing guide
--skip-license skip check for license
--skip-bootstrap skip check for bootstrap script
--skip-test-script skip check for test script
--skip-scripts skip check for all scripts
--no-color skip coloring the terminal output
--github, -g GitHub repository as owner/repo
--token, -t GitHub API access token [$FLINT_TOKEN]
--help, -h show help
--version, -v print the version
```

### Philosophy
Expand Down
108 changes: 108 additions & 0 deletions fixtures/octokit.rb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"id": 417862,
"name": "octokit.rb",
"full_name": "octokit/octokit.rb",
"owner": {
"login": "octokit",
"id": 3430433,
"avatar_url": "https://avatars.githubusercontent.com/u/3430433?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/octokit",
"html_url": "https://github.com/octokit",
"followers_url": "https://api.github.com/users/octokit/followers",
"following_url": "https://api.github.com/users/octokit/following{/other_user}",
"gists_url": "https://api.github.com/users/octokit/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octokit/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octokit/subscriptions",
"organizations_url": "https://api.github.com/users/octokit/orgs",
"repos_url": "https://api.github.com/users/octokit/repos",
"events_url": "https://api.github.com/users/octokit/events{/privacy}",
"received_events_url": "https://api.github.com/users/octokit/received_events",
"type": "Organization",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/octokit/octokit.rb",
"description": "Ruby toolkit for the GitHub API",
"fork": false,
"url": "https://api.github.com/repos/octokit/octokit.rb",
"forks_url": "https://api.github.com/repos/octokit/octokit.rb/forks",
"keys_url": "https://api.github.com/repos/octokit/octokit.rb/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/octokit/octokit.rb/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/octokit/octokit.rb/teams",
"hooks_url": "https://api.github.com/repos/octokit/octokit.rb/hooks",
"issue_events_url": "https://api.github.com/repos/octokit/octokit.rb/issues/events{/number}",
"events_url": "https://api.github.com/repos/octokit/octokit.rb/events",
"assignees_url": "https://api.github.com/repos/octokit/octokit.rb/assignees{/user}",
"branches_url": "https://api.github.com/repos/octokit/octokit.rb/branches{/branch}",
"tags_url": "https://api.github.com/repos/octokit/octokit.rb/tags",
"blobs_url": "https://api.github.com/repos/octokit/octokit.rb/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/octokit/octokit.rb/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/octokit/octokit.rb/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/octokit/octokit.rb/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/octokit/octokit.rb/statuses/{sha}",
"languages_url": "https://api.github.com/repos/octokit/octokit.rb/languages",
"stargazers_url": "https://api.github.com/repos/octokit/octokit.rb/stargazers",
"contributors_url": "https://api.github.com/repos/octokit/octokit.rb/contributors",
"subscribers_url": "https://api.github.com/repos/octokit/octokit.rb/subscribers",
"subscription_url": "https://api.github.com/repos/octokit/octokit.rb/subscription",
"commits_url": "https://api.github.com/repos/octokit/octokit.rb/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/octokit/octokit.rb/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/octokit/octokit.rb/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/octokit/octokit.rb/issues/comments/{number}",
"contents_url": "https://api.github.com/repos/octokit/octokit.rb/contents/{+path}",
"compare_url": "https://api.github.com/repos/octokit/octokit.rb/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/octokit/octokit.rb/merges",
"archive_url": "https://api.github.com/repos/octokit/octokit.rb/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/octokit/octokit.rb/downloads",
"issues_url": "https://api.github.com/repos/octokit/octokit.rb/issues{/number}",
"pulls_url": "https://api.github.com/repos/octokit/octokit.rb/pulls{/number}",
"milestones_url": "https://api.github.com/repos/octokit/octokit.rb/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octokit/octokit.rb/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/octokit/octokit.rb/labels{/name}",
"releases_url": "https://api.github.com/repos/octokit/octokit.rb/releases{/id}",
"created_at": "2009-12-10T21:41:49Z",
"updated_at": "2014-12-06T03:59:19Z",
"pushed_at": "2014-12-03T20:42:51Z",
"git_url": "git://github.com/octokit/octokit.rb.git",
"ssh_url": "[email protected]:octokit/octokit.rb.git",
"clone_url": "https://github.com/octokit/octokit.rb.git",
"svn_url": "https://github.com/octokit/octokit.rb",
"homepage": "http://octokit.github.io/octokit.rb/",
"size": 16270,
"stargazers_count": 1734,
"watchers_count": 1734,
"language": "Ruby",
"has_issues": true,
"has_downloads": true,
"has_wiki": false,
"has_pages": true,
"forks_count": 366,
"mirror_url": null,
"open_issues_count": 3,
"forks": 366,
"open_issues": 3,
"watchers": 1734,
"default_branch": "master",
"organization": {
"login": "octokit",
"id": 3430433,
"avatar_url": "https://avatars.githubusercontent.com/u/3430433?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/octokit",
"html_url": "https://github.com/octokit",
"followers_url": "https://api.github.com/users/octokit/followers",
"following_url": "https://api.github.com/users/octokit/following{/other_user}",
"gists_url": "https://api.github.com/users/octokit/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octokit/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octokit/subscriptions",
"organizations_url": "https://api.github.com/users/octokit/orgs",
"repos_url": "https://api.github.com/users/octokit/repos",
"events_url": "https://api.github.com/users/octokit/events{/privacy}",
"received_events_url": "https://api.github.com/users/octokit/received_events",
"type": "Organization",
"site_admin": false
},
"network_count": 366,
"subscribers_count": 81
}
Loading