Skip to content

Commit

Permalink
Merge branch 'main' into xlson/cloudmigration-api-permissions
Browse files Browse the repository at this point in the history
* main: (482 commits)
  I18N: Split loadTranslations i18next plugin into seperate file (#86217)
  Grafana UI: `StackingEditor` and `addHideFrom` - Replace `HorizontalGroup` with `Stack` (#86192)
  Dashboard: Migration -  Add public dashboard tag in the nav bar (#86204)
  mssql: decouple sqleng (#86130)
  Docs: Fix typos (#85651)
  Playlists: Enable kubernetesPlaylists by default in OSS (#86259)
  DashboardScene: Fixes saving dashboard with angular panels  (#86098)
  DashboardScene: Fix empty row repeat issue (#86095)
  Prometheus: Use the frontend package in Prometheus and remove feature toggle (#86080)
  docs: add annotations play link (#86206)
  Chore: add missing modowner (#86234)
  docs: add thresholds play link (#86212)
  docs: added logs panel play link; added dedup options, reformatted fig (#86209)
  docs: query data/relative time range override play link (#86213)
  Docs: added bar gauge play link (#86205)
  Docs: add template var Play link; cleanup existing (#86074)
  Prometheus: Add native histogram functions (#86002)
  K8s: add ID token to requests outbound to new query endpoint (#86214)
  Prometheus: Respect dashboard queries when querying ad hoc filter labels (#85674)
  Chore: Use `handleReducedMotion` to smooth the animation in `LoadingBar` (#85808)
  ...
  • Loading branch information
xlson committed Apr 16, 2024
2 parents 174ef53 + f110c05 commit 8c7b11e
Show file tree
Hide file tree
Showing 1,707 changed files with 38,830 additions and 47,449 deletions.
1,484 changes: 876 additions & 608 deletions .betterer.results

Large diffs are not rendered by default.

41 changes: 39 additions & 2 deletions .betterer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,35 @@ function countEslintErrors() {
'@emotion/syntax-preference': [2, 'object'],
'@typescript-eslint/no-explicit-any': 'error',
'@grafana/no-aria-label-selectors': 'error',
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['@grafana/ui*', '*/Layout/*'],
importNames: ['Layout', 'HorizontalGroup', 'VerticalGroup'],
message: 'Use Stack component instead.',
},
],
},
],
};

const nonTestFilesRules: Partial<Linter.RulesRecord> = {
...baseRules,
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }],
};

const grafanaRules: Partial<Linter.RulesRecord> = {
...nonTestFilesRules,
'no-barrel-files/no-barrel-files': 'error',
};

const testFilesAndGrafanaRules: Partial<Linter.RulesRecord> = {
...baseRules,
'no-barrel-files/no-barrel-files': 'error',
};

// group files by eslint config file
// this will create two file groups for each eslint config file
// one for test files and one for non-test files
Expand All @@ -105,18 +127,33 @@ function countEslintErrors() {
filePath.endsWith('.test.ts') ||
filePath.includes('__mocks__') ||
filePath.includes('public/test/');
const isGrafanaFile = filePath.includes('public/app/');

if (isTestFile) {
if (isGrafanaFile && isTestFile) {
configPath += '-test-grafana';
} else if (isGrafanaFile) {
configPath += '-grafana';
} else if (isTestFile) {
configPath += '-test';
}

if (!fileGroups[configPath]) {
fileGroups[configPath] = [];
}
fileGroups[configPath].push(filePath);
}

for (const configPath of Object.keys(fileGroups)) {
const rules = configPath.endsWith('-test') ? baseRules : nonTestFilesRules;
let rules;
if (configPath.endsWith('-test-grafana')) {
rules = testFilesAndGrafanaRules;
} else if (configPath.endsWith('-test')) {
rules = baseRules;
} else if (configPath.endsWith('-grafana')) {
rules = grafanaRules;
} else {
rules = nonTestFilesRules;
}
// this is by far the slowest part of this code. It takes eslint about 2 seconds just to find the config
const linterOptions = (await cli.calculateConfigForFile(fileGroups[configPath][0])) as Linter.Config;
const runner = new ESLint({
Expand Down
2 changes: 1 addition & 1 deletion .bingo/golangci-lint.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.21

toolchain go1.21.6
toolchain go1.21.9

require github.com/golangci/golangci-lint v1.57.1 // cmd/golangci-lint
Loading

0 comments on commit 8c7b11e

Please sign in to comment.