diff --git a/.github/workflows/wordlists_yml_linting.yml b/.github/workflows/wordlists_yml_linting.yml new file mode 100644 index 0000000..8771b5e --- /dev/null +++ b/.github/workflows/wordlists_yml_linting.yml @@ -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' diff --git a/Rakefile b/Rakefile index 494ec84..1689c3b 100644 --- a/Rakefile +++ b/Rakefile @@ -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 diff --git a/spec/wordlists_yml_spec.rb b/spec/wordlists_yml_lint.rb similarity index 99% rename from spec/wordlists_yml_spec.rb rename to spec/wordlists_yml_lint.rb index 7067488..2ac4d95 100644 --- a/spec/wordlists_yml_spec.rb +++ b/spec/wordlists_yml_lint.rb @@ -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'))