Skip to content

Commit 20116d2

Browse files
authored
Merge pull request #48 from CMU-313/add-jshint
feat: add github actions for JSHint
2 parents fd74fdd + f16e8d4 commit 20116d2

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525

2626
steps:
2727
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
2830

2931
- run: cp install/package.json package.json
3032

@@ -39,4 +41,14 @@ jobs:
3941
useLockFile: false
4042

4143
- name: Run JShint
42-
- run: ./node_modules/.bin/jshint .
44+
run: |
45+
git fetch origin main
46+
FILES=$(git diff --name-only origin/main...HEAD | grep '\.js$' || true)
47+
48+
if [ -z "$FILES" ]; then
49+
echo "No JS files changed"
50+
else
51+
echo "Running JSHint on:"
52+
echo "$FILES"
53+
./node_modules/.bin/jshint $FILES || echo "JSHint found potential issues in modified files."
54+
fi

src/admin/search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,4 @@ module.exports.filterDirectories = filterDirectories;
139139
module.exports.simplify = simplify;
140140
module.exports.sanitize = sanitize;
141141

142-
require('../promisify')(module.exports);
142+
require('../promisify')(module.exports);

src/api/categories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,4 +247,4 @@ categoriesAPI.setModerator = async (caller, { cid, member, set }) => {
247247

248248
const privilegeList = await privileges.categories.getUserPrivilegeList();
249249
await categoriesAPI.setPrivilege(caller, { cid, privilege: privilegeList, member, set });
250-
};
250+
};

0 commit comments

Comments
 (0)