Skip to content

Commit

Permalink
Merge pull request #52 from hahwul/refactor/issue-51
Browse files Browse the repository at this point in the history
Code Refactoring
  • Loading branch information
hahwul authored Feb 22, 2025
2 parents 016a95a + 2d94e66 commit da1fc72
Show file tree
Hide file tree
Showing 18 changed files with 470 additions and 256 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
name: RSpec
name: Tester
on:
pull_request:
jobs:
rspec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby 3.3
- name: Set up Ruby 3.4
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3' # Not needed with a `.ruby-version` or `.tool-versions`
ruby-version: '3.4' # Not needed with a `.ruby-version` or `.tool-versions`
bundler-cache: true # runs 'bundle install' and caches installed gems automaticallyz
- name: Test
run: bundle exec rspec -f j -o tmp/rspec_results.json -f p
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Linter
on:
pull_request:
jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby 3.4
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4' # Not needed with a `.ruby-version` or `.tool-versions`
bundler-cache: true # runs 'bundle install' and caches installed gems automaticallyz
- name: Test
run: bundle exec rubocop
13 changes: 9 additions & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ AllCops:
- 'bin/*'
- '*.gemspec'
- 'Gemfile*'
- 'lib/deadfinder/runner.rb'
- examples/**/*
SuggestExtensions: false

Style/MutableConstant:
Expand All @@ -20,29 +22,32 @@ Metrics/AbcSize:
Exclude:
- 'lib/deadfinder.rb'
- 'lib/deadfinder/utils.rb'
- 'lib/deadfinder/runner.rb'

Metrics/CyclomaticComplexity:
Exclude:
- 'lib/deadfinder.rb'
- 'lib/deadfinder/runner.rb'

Metrics/MethodLength:
Exclude:
- 'lib/deadfinder.rb'
- 'lib/deadfinder/utils.rb'
Max: 50

Metrics/PerceivedComplexity:
Exclude:
- 'lib/deadfinder.rb'
- 'lib/deadfinder/runner.rb'

Lint/SuppressedException:
Exclude:
- 'lib/deadfinder.rb'
- 'lib/deadfinder/runner.rb'

Security/Open:
Exclude:
- 'lib/deadfinder.rb'
- 'lib/deadfinder/runner.rb'

Metrics/BlockLength:
Max: 50
Exclude:
- 'spec/**/*'
- 'spec/**/*'
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ gem 'thor'
gem 'rspec'
gem 'yaml'
gem 'csv'
gem 'logger'
gem 'logger'
gem 'rubocop', '1.72.2'
gem 'rubocop-rspec'
gem 'webmock', '~> 3.14'
83 changes: 73 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,31 +1,64 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.2)
bigdecimal (3.1.9)
colorize (1.1.0)
concurrent-ruby (1.3.5)
concurrent-ruby-edge (0.7.2)
concurrent-ruby (~> 1.3)
crack (1.0.0)
bigdecimal
rexml
csv (3.3.2)
date (3.4.1)
diff-lcs (1.6.0)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.17.1-aarch64-linux-gnu)
ffi (1.17.1-aarch64-linux-musl)
ffi (1.17.1-arm-linux-gnu)
ffi (1.17.1-arm-linux-musl)
ffi (1.17.1-arm64-darwin)
ffi (1.17.1-x86_64-darwin)
ffi (1.17.1-x86_64-linux-gnu)
ffi (1.17.1-x86_64-linux-musl)
hashdiff (1.1.2)
json (2.10.1)
language_server-protocol (3.17.0.4)
lint_roller (1.1.0)
logger (1.6.6)
nokogiri (1.18.2-arm64-darwin)
nokogiri (1.18.3-aarch64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.2-x86_64-darwin)
nokogiri (1.18.3-aarch64-linux-musl)
racc (~> 1.4)
nokogiri (1.18.2-x86_64-linux-gnu)
nokogiri (1.18.3-arm-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.3-arm-linux-musl)
racc (~> 1.4)
nokogiri (1.18.3-arm64-darwin)
racc (~> 1.4)
nokogiri (1.18.3-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.18.3-x86_64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.3-x86_64-linux-musl)
racc (~> 1.4)
open-uri (0.5.0)
stringio
time
uri
parallel (1.26.3)
parser (3.3.7.1)
ast (~> 2.4.1)
racc
public_suffix (6.0.1)
racc (1.8.1)
rainbow (3.1.1)
regexp_parser (2.10.0)
rexml (3.4.1)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
Expand All @@ -39,25 +72,52 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.2)
rubocop (1.72.2)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.38.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.38.0)
parser (>= 3.3.1.0)
rubocop-rspec (3.5.0)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
ruby-progressbar (1.13.0)
set (1.1.1)
sitemap-parser (0.5.6)
nokogiri (~> 1.6)
typhoeus (>= 0.6, < 2.0)
stringio (3.1.3)
stringio (3.1.5)
thor (1.3.2)
time (0.4.1)
date
typhoeus (1.4.1)
ethon (>= 0.9.0)
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (1.0.2)
webmock (3.25.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
yaml (0.4.0)

PLATFORMS
arm64-darwin-22
arm64-darwin-23
arm64-darwin-24
x86_64-darwin-21
x86_64-linux
aarch64-linux-gnu
aarch64-linux-musl
arm-linux-gnu
arm-linux-musl
arm64-darwin
x86_64-darwin
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
colorize
Expand All @@ -68,10 +128,13 @@ DEPENDENCIES
nokogiri
open-uri (>= 0.4.0)
rspec
rubocop (= 1.72.2)
rubocop-rspec
set
sitemap-parser
thor
webmock (~> 3.14)
yaml

BUNDLED WITH
2.5.16
2.6.3
15 changes: 15 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Security Policy

## Reporting a Vulnerability

Found a security issue? Let us know so we can fix it.

### How to Report

* **For general security concerns**, please open a [GitHub issue](https://github.com/hahwul/deadfinder/issues). Use the `security` label and describe the issue in as much detail as you can. This helps us to understand and address the problem more effectively.
* **For sensitive matters**, we encourage you to directly email for [me](mailto:hahwul@gmail.com). Handling these issues discreetly is vital for everyone's safety.

## Conclusion
Your vigilance and willingness to report security issues are what help keep our project robust and secure. We appreciate the time and effort you put into making our community a safer place. Remember, no concern is too small; we're here to listen and act. Together, we can ensure a secure environment for all our users and contributors. Thank you for being an essential part of our project's security.

Thank you for your support in maintaining the security and integrity of our project!
24 changes: 12 additions & 12 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
---
name: DeadFinder Action
description: Find dead-links (broken links)
name: DeadFinder
description: A GitHub Action to find and report dead (broken) links in files, URLs, or sitemaps.
branding:
icon: link
color: purple
color: red
inputs:
command:
description: The command to run (file, url, sitemap)
description: The type of command to execute (options: file, url, sitemap)
required: true
target:
description: The target for the command
description: The target resource for the command (e.g., file path, URL, or sitemap URL)
required: true
timeout:
description: Timeout in seconds
description: The maximum time to wait for each request, in seconds
required: false
default: ''
concurrency:
description: Number of concurrency
description: The number of concurrent requests to make
required: false
default: ''
silent:
description: Silent mode
description: Enable silent mode to suppress output
required: false
default: 'false'
headers:
description: Custom HTTP headers to send with request, separated by commas
description: Custom HTTP headers to include in requests, separated by commas
required: false
default: ''
verbose:
description: Verbose mode
description: Enable verbose mode for detailed logging
required: false
default: 'false'
include30x:
description: Include 30x status code
description: Include HTTP 30x status codes in the results
required: false
default: 'false'
outputs:
output:
description: JSON Result
description: JSON formatted result of the dead-link check
runs:
using: docker
image: github-action/Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion deadfinder.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.homepage = 'https://www.hahwul.com/projects/deadfinder/'
s.license = 'MIT'
s.executables << 'deadfinder'
s.files = ['lib/deadfinder.rb', 'lib/deadfinder/utils.rb', 'lib/deadfinder/logger.rb', 'lib/deadfinder/version.rb']
s.files = ['lib/deadfinder.rb', 'lib/deadfinder/utils.rb', 'lib/deadfinder/logger.rb', 'lib/deadfinder/version.rb', 'lib/deadfinder/runner.rb', 'lib/deadfinder/cli.rb']
s.metadata['rubygems_mfa_required'] = 'true'
s.metadata['source_code_uri'] = 'https://github.com/hahwul/deadfinder'
s.required_ruby_version = '>= 3.3.0'
Expand Down
Loading

0 comments on commit da1fc72

Please sign in to comment.