Skip to content

Commit

Permalink
fix: address all failing lints (#17)
Browse files Browse the repository at this point in the history
* fix: address all failing lints

Fix failing workflows and get rid of repo related files that are no longer needed.

* chore: update gems

* fix: remove reference to pry
  • Loading branch information
andrewmcodes authored Apr 23, 2022
1 parent 2f91b2e commit 7334a82
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 115 deletions.
25 changes: 0 additions & 25 deletions .all-contributorsrc

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: build

on: [push]

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand All @@ -68,9 +68,9 @@ members of the project's leadership.
## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
<https://www.contributor-covenant.org/faq>
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Hey, there! 👋 Any and all contributions are welcome.
Please make sure to read the [code of conduct][code-of-conduct] before submitting issues or pull requests.

To lend a helping hand:

* [Fork the repository](https://help.github.com/articles/fork-a-repo/)
* Make your desired changes
* [Create a pull request](https://help.github.com/articles/creating-a-pull-request/)
7 changes: 3 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ group :development do
end

group :test do
gem "json", "~> 2.2"
gem "pry", "~> 0.12.2"
gem "rspec", "~> 3.9.0"
gem "webmock", "~> 3.7", ">= 3.7.6"
gem "json", "~> 2.6.1"
gem "rspec", "~> 3.11.0"
gem "webmock", "~> 3.14"
end
55 changes: 24 additions & 31 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,39 +1,34 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.7.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.2)
coderay (1.1.2)
crack (0.4.3)
safe_yaml (~> 1.0.0)
diff-lcs (1.3)
hashdiff (1.0.0)
json (2.2.0)
method_source (0.9.2)
crack (0.4.5)
rexml
diff-lcs (1.5.0)
hashdiff (1.0.1)
json (2.6.1)
parallel (1.22.1)
parser (3.1.2.0)
ast (~> 2.4.1)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
public_suffix (4.0.1)
rainbow (3.0.0)
public_suffix (4.0.7)
rainbow (3.1.1)
regexp_parser (2.3.0)
rexml (3.2.5)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.0)
rspec-support (~> 3.9.0)
rspec-expectations (3.9.0)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rubocop (1.27.0)
parallel (~> 1.10)
parser (>= 3.1.0.0)
Expand All @@ -49,25 +44,23 @@ GEM
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-progressbar (1.11.0)
safe_yaml (1.0.5)
standard (1.10.0)
rubocop (= 1.27.0)
rubocop-performance (= 1.13.3)
unicode-display_width (2.1.0)
webmock (3.7.6)
addressable (>= 2.3.6)
webmock (3.14.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)

PLATFORMS
ruby

DEPENDENCIES
json (~> 2.2)
pry (~> 0.12.2)
rspec (~> 3.9.0)
json (~> 2.6.1)
rspec (~> 3.11.0)
standard (~> 1.10)
webmock (~> 3.7, >= 3.7.6)
webmock (~> 3.14)

BUNDLED WITH
2.2.33
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Andrew Mason
Copyright (c) 2019-2022 Andrew Mason

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
35 changes: 0 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,6 @@

A GitHub Action to run [StandardRB](https://github.com/testdouble/standard) against your code and create annotations in the GitHub UI.

- [:white_check_mark: StandardRB Action](#whitecheckmark-standardrb-action)
- [:page_facing_up: Introduction](#pagefacingup-introduction)
- [:bulb: Usage](#bulb-usage)
- [:package: Example Workflow](#package-example-workflow)
- [:warning: Gotchas](#warning-gotchas)
- [:camera_flash: Screenshots](#cameraflash-screenshots)
- [:bookmark: Changelog](#bookmark-changelog)
- [:sos: Contributing](#sos-contributing)
- [:rotating_light: Code of Conduct](#rotatinglight-code-of-conduct)
- [:copyright: License](#copyright-license)
- [:robot: Check Out My Other Ruby GitHub Actions](#robot-check-out-my-other-ruby-github-actions)
- [✨ Contributors](#%e2%9c%a8-contributors)

## :page_facing_up: Introduction

GitHub Actions are an amazing new tool that can dramatically improve productivity while using the GitHub platform. While it is not hard to write a custom GitHub action to run StandardRB on your codebase, this action takes that functionality one step further using the checks API. After the StandardRB Linter Action runs StandardRB against your code, it will create annotations that you can easily view, matched up with the offending code.
Expand Down Expand Up @@ -87,25 +74,3 @@ Due to the GitHub Check Runs API, we can only return 50 annotations per run. See
## :copyright: License
[MIT](/LICENSE.md)
## :robot: Check Out My Other Ruby GitHub Actions
- [andrewmcodes/rubocop-linter-action](https://github.com/andrewmcodes/rubocop-linter-action).
- [andrewmcodes/haml-lint-action](https://github.com/andrewmcodes/haml-lint-action).
## ✨ Contributors
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
<table>
<tr>
<td align="center"><a href="https://www.andrewmason.me/"><img src="https://avatars1.githubusercontent.com/u/18423853?v=4" width="100px;" alt="Andrew Mason"/><br /><sub><b>Andrew Mason</b></sub></a><br /><a href="#infra-andrewmcodes" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/andrewmcodes/standardrb-action/commits?author=andrewmcodes" title="Documentation">📖</a> <a href="https://github.com/andrewmcodes/standardrb-action/commits?author=andrewmcodes" title="Code">💻</a></td>
</tr>
</table>
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
4 changes: 2 additions & 2 deletions lib/github_check_run_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def base_payload(status)
name: CHECK_NAME,
head_sha: @github_data[:sha],
status: status,
started_at: Time.now.iso8601,
started_at: Time.now.iso8601
}
end

Expand All @@ -50,7 +50,7 @@ def update_check_payload
output: {
title: CHECK_NAME,
summary: @summary,
annotations: @annotations,
annotations: @annotations
}
)
end
Expand Down
6 changes: 3 additions & 3 deletions lib/github_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ def post(url, body = {})
def headers
@headers ||= {
"Content-Type": "application/json",
"Accept": "application/vnd.github.antiope-preview+json",
"Authorization": "Bearer #{@github_token}",
"User-Agent": @user_agent,
Accept: "application/vnd.github.antiope-preview+json",
Authorization: "Bearer #{@github_token}",
"User-Agent": @user_agent
}
end

Expand Down
2 changes: 1 addition & 1 deletion lib/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def read_json(path)
sha: ENV["GITHUB_SHA"],
token: ENV["GITHUB_TOKEN"],
owner: ENV["GITHUB_REPOSITORY_OWNER"] || @event_json.dig("repository", "owner", "login"),
repo: ENV["GITHUB_REPOSITORY_NAME"] || @event_json.dig("repository", "name"),
repo: ENV["GITHUB_REPOSITORY_NAME"] || @event_json.dig("repository", "name")
}
@report =
if ENV["REPORT_PATH"]
Expand Down
16 changes: 8 additions & 8 deletions lib/report_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class << self
"convention" => "failure",
"warning" => "warning",
"error" => "failure",
"fatal" => "failure",
"fatal" => "failure"
}.freeze

def conclusion(report)
Expand All @@ -33,13 +33,13 @@ def annotations(report)
same_line = location["start_line"] == location["last_line"]
annotation_list.push(
{
'path': file["path"],
'start_line': location["start_line"],
'end_line': location["last_line"],
'start_column': (location["start_column"] if same_line),
'end_column': (location["last_column"] if same_line),
'annotation_level': annotation_level(offense["severity"]),
'message': offense["message"],
path: file["path"],
start_line: location["start_line"],
end_line: location["last_line"],
start_column: (location["start_column"] if same_line),
end_column: (location["last_column"] if same_line),
annotation_level: annotation_level(offense["severity"]),
message: offense["message"]
}.compact.transform_keys!(&:to_s)
)
end
Expand Down
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

require "webmock/rspec"
require "json"
require "pry"
require "./lib/report_adapter"
require "./lib/github_check_run_service"
require "./lib/github_client"

0 comments on commit 7334a82

Please sign in to comment.