How to use the sourcegraph.checks function in sourcegraph

To help you get started, we’ve selected a few sourcegraph examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sourcegraph / sourcegraph / extensions / enterprise / check-search / src / codeDuplication.ts View on Github external
function registerCheckProvider(diagnostics: Observable): Unsubscribable {
    const subscriptions = new Subscription()
    subscriptions.add(
        sourcegraph.checks.registerCheckProvider('codeDuplication', () => ({
            information: diagnostics.pipe(
                map(diagnostics => {
                    const info: sourcegraph.CheckInformation = {
                        description: {
                            kind: sourcegraph.MarkupKind.Markdown,
                            value:
                                'Checks for code duplication using [**jscpd**](https://github.com/kucherenko/jscpd), a copy-paste detector with support for 150+ languages.',
                        },
                        state:
                            diagnostics === LOADING
                                ? {
                                      completion: sourcegraph.CheckCompletion.InProgress,
                                      message: 'Running jscpd...',
                                  }
                                : {
                                      completion: sourcegraph.CheckCompletion.Completed,
github sourcegraph / sourcegraph / extensions / enterprise / check-search / src / eslint.ts View on Github external
function registerCheckProvider(diagnostics: Observable): Unsubscribable {
    const subscriptions = new Subscription()
    subscriptions.add(
        sourcegraph.checks.registerCheckProvider('eslint', () => ({
            information: diagnostics.pipe(
                map(diagnostics => {
                    const info: sourcegraph.CheckInformation = {
                        description: {
                            kind: sourcegraph.MarkupKind.Markdown,
                            value: 'Checks code using ESLint, an open-source JavaScript linting utility.',
                        },
                        state:
                            diagnostics === LOADING
                                ? {
                                      completion: sourcegraph.CheckCompletion.InProgress,
                                      message: 'Running ESLint...',
                                  }
                                : {
                                      completion: sourcegraph.CheckCompletion.Completed,
                                      result: