Skip to content

Commit

Permalink
Merge pull request #456 from DinoChiesa/rcfile-debug
Browse files Browse the repository at this point in the history
chore: add debug messages for apigeelint rc file
  • Loading branch information
ssvaidyanathan authored Aug 24, 2024
2 parents 6023845 + 518d89b commit f156a0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const program = require("commander"),
rc = require("./lib/package/apigeelintrc.js"),
pkj = require("./package.json"),
bundleType = require("./lib/package/BundleTypes.js");
const debug = require("debug");

const findBundle = (p) => {
if (p.endsWith("/")) {
Expand Down Expand Up @@ -129,7 +130,10 @@ if (!program.norc) {
if (rcSettings) {
Object.keys(rcSettings)
.filter((key) => key != "path" && key != "list" && !program[key])
.forEach((key) => (program[key] = rcSettings[key]));
.forEach((key) => {
debug("apigeelint:rc")(`applying [${key}] = ${rcSettings[key]}`) ;
program[key] = rcSettings[key];
});
}
}

Expand Down
4 changes: 3 additions & 1 deletion lib/package/apigeelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ------------------------------------------------------------------
//
// created: Mon Apr 15 18:14:54 2024
// last saved: <2024-April-16 13:54:37>
// last saved: <2024-July-19 12:24:12>

/* jshint esversion:9, node:true, strict:implied */
/* global process, console, Buffer */
Expand All @@ -11,6 +11,7 @@ const os = require("os");
const fs = require("fs");
const path = require("path");
const bundleType = require("./BundleTypes.js");
const debug = require("debug")("apigeelint:rc");

const locations = ["./", "~/"];

Expand Down Expand Up @@ -38,6 +39,7 @@ const findRc = (settingsfiles, sourcedir) => {
const readRc = (settingsfiles, sourcedir) => {
const rcFile = findRc(settingsfiles, sourcedir);
if (rcFile) {
debug(`found rc file ${rcFile}`);
const lines = fs
.readFileSync(rcFile, "utf-8")
.split("\n")
Expand Down

0 comments on commit f156a0a

Please sign in to comment.