How to use the sourcegraph.CheckCompletion 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 / eslint.ts View on Github external
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:
                                          diagnostics.length > 0
                                              ? sourcegraph.CheckResult.Failure
                                              : sourcegraph.CheckResult.Success,
                                      message:
                                          diagnostics.length > 0
                                              ? 'ESLint problems found'
                                              : 'Code is compliant with ESLint',
                                  },
                        sections: {
                            settings: {
                                kind: sourcegraph.MarkupKind.Markdown,
github sourcegraph / sourcegraph / extensions / enterprise / check-search / src / codeDuplication.ts View on Github external
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,
                                      result:
                                          diagnostics.length > 0
                                              ? sourcegraph.CheckResult.Failure
                                              : sourcegraph.CheckResult.Success,
                                      message:
                                          diagnostics.length > 0 ? 'Duplicated code found' : 'No duplicated code found',
                                  },
                        sections: {
                            settings: {
                                kind: sourcegraph.MarkupKind.Markdown,
                                value: `
- Use \`jscpd@2.0.15\`