Skip to content

Commit

Permalink
processors/awesome_lint: check that depends_3rdparty is a valid boo…
Browse files Browse the repository at this point in the history
…lean value (`true/false/True/False`)
  • Loading branch information
nodiscc committed Nov 13, 2023
1 parent 2f96147 commit 7bc1d11
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/).

#### [v1.2.3](https://github.com/nodiscc/hecat/releases/tag/1.2.3) - UNRELEASED

**Changed:**
- processors/awesome_lint: check that `depends_3rdparty` is a valid boolean value (`true/false/True/False`)

---------------------

#### [v1.2.2](https://github.com/nodiscc/hecat/releases/tag/1.2.2) - 2023-11-03

**Changed:**
Expand Down
8 changes: 8 additions & 0 deletions hecat/processors/awesome_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ def check_last_updated(software, step, errors):
else:
logging.debug('%s: last updated %s ago', software['name'], time_since_last_update)

def check_boolean_attributes(software, errors):
"""check if the depends_3rdparty attribute is a boolean"""
if 'depends_3rdparty' in software:
if not type(software['depends_3rdparty']) == bool:
message = '{}: depends_3rdparty must be a valid boolean value (true/false/True/False), got "{}"'.format(software['name'], software['depends_3rdparty'])
log_exception(message, errors, severity=logging.error)

def awesome_lint(step):
"""check all software entries against awesome-selfhosted formatting guidelines"""
logging.info('checking software entries/tags against awesome-selfhosted formatting guidelines.')
Expand Down Expand Up @@ -228,6 +235,7 @@ def awesome_lint(step):
check_external_link_syntax(software, errors)
check_not_archived(software, errors)
check_last_updated(software, step, errors)
check_boolean_attributes(software, errors)
for license in licenses_list:
check_required_fields(license, errors, required_fields=LICENSES_REQUIRED_FIELDS)
if errors:
Expand Down

0 comments on commit 7bc1d11

Please sign in to comment.