2020-04-24 19:29:53 -04:00
|
|
|
/**
|
|
|
|
* @license
|
2020-05-19 15:08:49 -04:00
|
|
|
* Copyright Google LLC All Rights Reserved.
|
2020-04-24 19:29:53 -04:00
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2020-05-08 17:51:29 -04:00
|
|
|
import {getFormatConfig} from '../config';
|
2020-04-24 19:29:53 -04:00
|
|
|
|
|
|
|
import {Buildifier} from './buildifier';
|
|
|
|
import {ClangFormat} from './clang-format';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get all defined formatters which are active based on the current loaded config.
|
|
|
|
*/
|
|
|
|
export function getActiveFormatters() {
|
2020-05-08 17:51:29 -04:00
|
|
|
const config = getFormatConfig().format;
|
2020-04-24 19:29:53 -04:00
|
|
|
return [new Buildifier(config), new ClangFormat(config)].filter(
|
|
|
|
formatter => formatter.isEnabled());
|
|
|
|
}
|
|
|
|
|
|
|
|
// Rexport symbols used for types elsewhere.
|
|
|
|
export {Formatter, FormatterAction} from './base-formatter';
|