diff --git a/CHANGELOG.md b/CHANGELOG.md index c07b6e0..3b27870 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,20 @@ # Changelog -## v1.3.0 +## v1.3.1 +- Both `.github/config.yml` and `.github/config.yaml` are now supported for the app's configuration. +- Fixed a number of misconfigurations when mapping file extensions to their comment delimiters. + + +## v1.3.0 + - The app will now always include the results of the action item search in the check run summary. - Added an option that allows you to ignore files that match a specific pattern. - Added an option to enable multiline block comments. This option is disabled by default, as it may cause the app to incorrectly identify action items. - If the app encounters an error while the check is running, the check will now be concluded as neutral and the error message will be included in the check run summary. - Fixed a bug where setting one of the values of the `add_languages` option to `null` would cause the app to not accept any new languages. - Fixed a bug where the app would incorrectly classify a line as not being part of a block comment. - ## v1.2.0 diff --git a/app.rb b/app.rb index 4753ffd..96be248 100644 --- a/app.rb +++ b/app.rb @@ -184,7 +184,8 @@ def get_app_options(full_repo_name, head_sha) 'ignore_files' => ->(value) { value.is_a?(Array) && (1..7).include?(value.size) && value.all? { |v| v.is_a?(String) && %r{\A(/?(\*\*/)?[\w*\[\]{}?\.\/-]+(/\*\*)?/?)\Z}.match?(v) } } } - file = @installation_client.contents(full_repo_name, path: '.github/config.yml', ref: head_sha) + file = @installation_client.contents(full_repo_name, path: '.github/config.yml', ref: head_sha) rescue nil + file ||= @installation_client.contents(full_repo_name, path: '.github/config.yaml', ref: head_sha) decoded_file = Base64.decode64(file.content) file_options = YAML.safe_load(decoded_file)['todo-pr-checker'] || {} @@ -198,7 +199,7 @@ def get_app_options(full_repo_name, head_sha) end end rescue Octokit::NotFound - logger.debug 'No .github/config.yml found, or options validation failed. Using default options.' + logger.debug 'No .github/config.yml or .github/config.yaml found, or options validation failed. Using default options.' default_options end @@ -301,13 +302,20 @@ def check_for_todos(changes, options) # (6) Retrieves the file types and comment characters for the app's supported languages, and user defined values def get_comment_chars(added_languages) default_comment_chars = { - %w[md html astro xml] => { line: '' }, - %w[js java ts c cpp cs php swift go kotlin rust dart scala groovy sql css less sass scss] => { line: '//', block_start: '/*', block_end: '*/' }, - %w[rb perl] => { line: '#', block_start: '=begin', block_end: '=end' }, + %w[md html xml] => { line: '' }, + %w[astro] => { line: '//', block_start: '' }, + %w[js java ts c cpp cs php swift go kt rs dart sc groovy less sass scss] => { line: '//', block_start: '/*', block_end: '*/' }, + %w[css] => { line: '/*', block_start: '/*', block_end: '*/' }, + %w[r gitignore sh bash yml yaml] => { line: '#', block_start: nil, block_end: nil }, + %w[rb] => { line: '#', block_start: '=begin', block_end: '=end' }, + %w[pl] => { line: '#', block_start: '=', block_end: '=cut' }, %w[py] => { line: '#', block_start: "'''", block_end: "'''" }, - %w[r shell gitignore sh bash yml yaml ps1] => { line: '#', block_start: nil, block_end: nil }, - %w[haskell lua] => { line: '--', block_start: '{-', block_end: '-}' }, - %w[m tex] => { line: '%', block_start: nil, block_end: nil } + %w[ps1] => { line: '#', block_start: '<#', block_end: '#>' }, + %w[sql] => { line: '--', block_start: '/*', block_end: '*/' }, + %w[hs] => { line: '--', block_start: '{-', block_end: '-}' }, + %w[lua] => { line: '--', block_start: '--[[', block_end: ']]' }, + %w[m] => { line: '%', block_start: '%{', block_end: '%}' }, + %w[tex] => { line: '%', block_start: nil, block_end: nil } } unwrapped_comment_chars = {} diff --git a/version.rb b/version.rb index 4d74e07..1fd1404 100644 --- a/version.rb +++ b/version.rb @@ -1,3 +1,3 @@ # frozen_string_literal: true -VERSION = '1.3.0' +VERSION = '1.3.1'