Skip to content

Commit

Permalink
Run data/wordlists.yml linting tests separately from the specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Aug 1, 2024
1 parent c55dc75 commit 1adf8e2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/wordlists_yml_linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: wordlists.yml linting

on:
push:
paths:
- data/wordlists.yml
- spec/wordlists_yml_lint.rb
pull_request:
paths:
- data/wordlists.yml
- spec/wordlists_yml_lint.rb

jobs:
# data/wordlists.yml linting
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
- name: Install dependencies
run: bundle install --jobs 4 --retry 3
- name: Run data/wordlists.yml linting
run: 'bundle exec rake spec:lint'
9 changes: 8 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ Gem::Tasks.new(sign: {checksum: true, pgp: true})
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
task :test => :spec
task :default => :spec
task :default => :test

namespace :spec do
RSpec::Core::RakeTask.new(:lint) do |t|
t.pattern = 'spec/{**/}*_lint.rb'
end
end
task :lint => 'spec:lint'

require 'yard'
YARD::Rake::YardocTask.new
Expand Down
1 change: 1 addition & 0 deletions spec/wordlists_yml_spec.rb → spec/wordlists_yml_lint.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'spec_helper'
require 'yaml'
require 'uri'

describe "data/wordlists.yml" do
wordlists = YAML.load_file(File.join(__dir__,'..','data','wordlists.yml'))
Expand Down

0 comments on commit 1adf8e2

Please sign in to comment.