Skip to content

Commit

Permalink
processors/awesome_lint: fix displayed number of days in `older than …
Browse files Browse the repository at this point in the history
…... days` for error-level messages
  • Loading branch information
nodiscc committed Aug 1, 2023
1 parent d58ce6c commit b5c4d62
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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.0](https://github.com/nodiscc/hecat/releases#1.2.0) - UNLEREASED

**Fixed:**
- processors/awesome_lint: fix displayed number of days in `older than ... days` for error-level messages

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

#### [v1.1.0](https://github.com/nodiscc/hecat/releases#1.1.0) - 2023-07-29

**Added:**
Expand Down
2 changes: 1 addition & 1 deletion hecat/processors/awesome_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def check_last_updated(software, step, errors):
last_update_time = datetime.strptime(software['updated_at'], "%Y-%m-%d")
time_since_last_update = last_update_time - datetime.now()
if last_update_time < datetime.now() - timedelta(days=step['module_options']['last_updated_error_days']):
message = '{}: last updated {} ago, older than {} days'.format(software['name'], time_since_last_update, step['module_options']['last_updated_warn_days'])
message = '{}: last updated {} ago, older than {} days'.format(software['name'], time_since_last_update, step['module_options']['last_updated_error_days'])
log_exception(message, errors, severity=logging.error)
if last_update_time < datetime.now() - timedelta(days=step['module_options']['last_updated_warn_days']):
logging.warning('%s: last updated %s ago, older than %s days', software['name'], time_since_last_update, step['module_options']['last_updated_warn_days'])
Expand Down

0 comments on commit b5c4d62

Please sign in to comment.