diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 6e88c97..1ed701f 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -10,7 +10,7 @@ permissions: contents: read jobs: - test: + rubocop: name: RuboCop runs-on: ubuntu-latest diff --git a/.github/workflows/yard.yml b/.github/workflows/yard.yml new file mode 100644 index 0000000..1f0b511 --- /dev/null +++ b/.github/workflows/yard.yml @@ -0,0 +1,28 @@ +name: YARD + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +permissions: + contents: read + +jobs: + yard: + name: YARD + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.6.10' + bundler-cache: false + rubygems: latest + - name: Lint YARD documentation + run: | + gem install yard + yard doc --fail-on-warning --no-output --no-progress diff --git a/lib/utils.rb b/lib/utils.rb index 57ec1fb..746bb42 100644 --- a/lib/utils.rb +++ b/lib/utils.rb @@ -21,7 +21,7 @@ def self.symbolize_keys(obj) # Converts a language code to its corresponding ISO 639-2 (alpha-3) code. # # @param [String] language The ISO 639-1 (alpha-2) or ISO 639-2 (alpha-3) language code. - # @return [String] The ISO 639-2 (alpha-3) language code, or `nil` if the code is not found. + # @return [String, nil] The ISO 639-2 (alpha-3) language code, or `nil` if the language is not found. def self.language_alpha3(language) ISO_639.find(language)&.alpha3 end