reviewbot

Source code for the is-a.dev r...
Log | Files | Refs | README | LICENSE

commit 5759779cbcc683b47f2d9526e704a99104ea79d2
parent ab7e51f810e6d6613832e5cad82d066b9fd94515
Author: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com>
Date:   Wed,  1 Jul 2026 15:51:40 -0400

chore: fixing iospta terrible code fr fr ong (#69)

* chore: update order of imports

* chore: reorder imports

* chore: reorder imports

* chore: reorder imports

* chore: adding code hints for easy

Updated comment for clarity and consistency.

* chore: bump version to 1.6.1
Diffstat:
Mpackage.json | 2+-
Msrc/index.js | 5++++-
Msrc/tools/numberofdays.js | 9++++++++-
Msrc/webhooks/closed.js | 3++-
Msrc/webhooks/labeled.js | 3++-
Msrc/webhooks/opened.js | 5+++--
6 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/package.json b/package.json @@ -1,7 +1,7 @@ { "name": "reviewbot", "private": true, - "version": "1.6.0", + "version": "1.6.1", "type": "module", "description": "An app to assist in the review process of is-a-dev", "author": "iostpa", diff --git a/src/index.js b/src/index.js @@ -4,15 +4,18 @@ import path from 'path'; import dotenv from 'dotenv'; import middie from '@fastify/middie'; import Fastify from 'fastify'; +import Database from 'better-sqlite3'; + import { App } from 'octokit'; import { createNodeMiddleware } from '@octokit/webhooks'; import { CronJob } from 'cron'; + import { getNumberOfDays } from './tools/numberofdays.js'; + import { unlabeled } from './webhooks/unlabeled.js'; import { opened } from './webhooks/opened.js'; import { closed } from './webhooks/closed.js'; import { labeled } from './webhooks/labeled.js'; -import Database from 'better-sqlite3'; // Load environment variables from .env file dotenv.config(); diff --git a/src/tools/numberofdays.js b/src/tools/numberofdays.js @@ -1,3 +1,10 @@ +/** + * Calculates the number of days between two dates. + * + * @param {string | Date} start - The start date. + * @param {string | Date} end - The end date. + * @returns {number} The number of days between the dates. + */ export function getNumberOfDays(start, end) { const date1 = new Date(start); const date2 = new Date(end); @@ -8,7 +15,7 @@ export function getNumberOfDays(start, end) { // Calculating the time difference between two dates const diffInTime = date2.getTime() - date1.getTime(); - // Calculating the no. of days between two dates + // Calculating the number of days between two dates const diffInDays = Math.round(diffInTime / oneDay); return diffInDays; diff --git a/src/webhooks/closed.js b/src/webhooks/closed.js @@ -1,7 +1,8 @@ -import { db } from '../index.js'; import fs from 'fs'; import path from 'path'; +import { db } from '../index.js'; + const ignoreLabels = ['maintainer']; const mergedPRs = fs.readFileSync( path.join(import.meta.dirname, '../message/merged.md'), diff --git a/src/webhooks/labeled.js b/src/webhooks/labeled.js @@ -1,7 +1,8 @@ -import { db } from '../index.js'; import fs from 'fs'; import path from 'path'; +import { db } from '../index.js'; + const reasonLabels = [ 'reason: abuse risk', 'reason: commercial usage', diff --git a/src/webhooks/opened.js b/src/webhooks/opened.js @@ -1,8 +1,9 @@ -import { db, numberOfDays } from '../index.js'; -import { getNumberOfDays } from '../tools/numberofdays.js'; import fs from 'fs'; import path from 'path'; +import { db, numberOfDays } from '../index.js'; +import { getNumberOfDays } from '../tools/numberofdays.js'; + const ignoreLabels = ['maintainer']; const newPRs = fs.readFileSync( path.join(import.meta.dirname, '../message/opened.md'),
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror