@atomist/sdm-pack-sloc
Version:
Extension Pack for an Atomist SDM to integrate code metrics
42 lines • 1.82 kB
JavaScript
;
/*
* Copyright © 2019 Atomist, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
const sdm_1 = require("@atomist/sdm");
const CodeMetrics_1 = require("./lib/codemetrics/CodeMetrics");
const slocCommand_1 = require("./lib/slocCommand");
var CodeMetrics_2 = require("./lib/codemetrics/CodeMetrics");
exports.calculateCodeMetrics = CodeMetrics_2.calculateCodeMetrics;
var slocReport_1 = require("./lib/slocReport");
exports.LanguageReport = slocReport_1.LanguageReport;
exports.LanguagesReport = slocReport_1.LanguagesReport;
exports.reportForLanguages = slocReport_1.reportForLanguages;
/**
* Extension pack to add codeMetrics commands to a machine
* and optionally, fingerprint with lines of code after every push.
* @param fingerprint if this is set, automatic fingerprinting will
* happen on every push
*/
function codeMetrics(fingerprint) {
return Object.assign({}, sdm_1.metadata(), { configure: sdm => {
sdm.addCodeInspectionCommand(slocCommand_1.SlocCommand);
if (!!fingerprint) {
fingerprint.fingerprintGoal.with(CodeMetrics_1.lineCountFingerprinter(fingerprint.pushTest));
}
} });
}
exports.codeMetrics = codeMetrics;
//# sourceMappingURL=index.js.map