mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-19 12:35:32 +00:00
fix: #672 Empty execution tracking ID in InternalLogEntry (backport to release/2k)
This commit is contained in:
58
frontend/node_modules/stylelint/lib/formatters/githubFormatter.cjs
generated
vendored
Normal file
58
frontend/node_modules/stylelint/lib/formatters/githubFormatter.cjs
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
// NOTICE: This file is generated by Rollup. To modify it,
|
||||
// please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
|
||||
'use strict';
|
||||
|
||||
const preprocessWarnings = require('./preprocessWarnings.cjs');
|
||||
|
||||
/**
|
||||
* @see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
|
||||
*
|
||||
* @type {import('stylelint').Formatter}
|
||||
*
|
||||
* @deprecated See https://stylelint.io/awesome-stylelint#formatters for alternative formatters.
|
||||
*/
|
||||
function githubFormatter(results, returnValue) {
|
||||
const title = 'Stylelint problem';
|
||||
const metadata = returnValue.ruleMetadata;
|
||||
|
||||
const lines = results.flatMap((result) => {
|
||||
const { source, warnings } = preprocessWarnings(result);
|
||||
|
||||
return warnings.map(({ line, column, endLine, endColumn, text, severity, rule }) => {
|
||||
const msg = buildMessage(text, metadata[rule]);
|
||||
|
||||
return endLine === undefined
|
||||
? `::${severity} file=${source},line=${line},col=${column},title=${title}::${msg}`
|
||||
: `::${severity} file=${source},line=${line},col=${column},endLine=${endLine},endColumn=${endColumn},title=${title}::${msg}`;
|
||||
});
|
||||
});
|
||||
|
||||
lines.push(`::notice title=Stylelint deprecation::The github formatter is deprecated`);
|
||||
lines.push('');
|
||||
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} msg
|
||||
* @param {Partial<import('stylelint').RuleMeta> | undefined} metadata
|
||||
* @returns {string}
|
||||
*/
|
||||
function buildMessage(msg, metadata) {
|
||||
if (!metadata) return msg;
|
||||
|
||||
const url = metadata.url ? ` - ${metadata.url}` : '';
|
||||
|
||||
let additional = [
|
||||
metadata.fixable ? 'maybe fixable' : '',
|
||||
metadata.deprecated ? 'deprecated' : '',
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(', ');
|
||||
|
||||
additional = additional ? ` [${additional}]` : '';
|
||||
|
||||
return `${msg}${additional}${url}`;
|
||||
}
|
||||
|
||||
module.exports = githubFormatter;
|
||||
Reference in New Issue
Block a user