-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(dev/ci): pre-commit fixes galore #32352
Conversation
@rusackas Ephemeral environment spinning up at http://54.186.129.54:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup. |
/korbit-review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
Category | Issue | Fix Detected |
---|---|---|
Redundant language module declarations ▹ view |
Files scanned
Due to the exceptionally large size of this PR, I've limited my review to the following files:
File Path | Reviewed |
---|---|
docs/babel.config.js | ✅ |
docs/src/utils.js | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/BoxPlot/NVD3BoxPlot.stories.tsx | ✅ |
docs/static/script/matomo.js | ✅ |
superset/common/db_query_status.py | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-chord/LegacyPluginChartChord.stories.tsx | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Gauge/Gauge.stories.tsx | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Graph/Graph.stories.tsx | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-color/RenderPalettes.tsx | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Waterfall/Waterfall.stories.tsx | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Radar/Radar.stories.tsx | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/shared/components/ResizablePanel.tsx | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-pivot-table/PivotTable.stories.tsx | ✅ |
docs/src/theme/DocItem/index.js | ✅ |
docs/src/components/SectionHeader.tsx | ✅ |
superset/db_engine_specs/hana.py | ✅ |
docs/.eslintrc.js | ✅ |
superset-frontend/src/types/react-syntax-highlighter.d.ts | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-table/testData.ts | ✅ |
superset/cli/thumbnails.py | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/shared/components/ResizableChartDemo.tsx | ✅ |
superset/utils/pandas_postprocessing/histogram.py | ✅ |
superset/db_engine_specs/oracle.py | ✅ |
superset-frontend/src/explore/actions/datasourcesActions.ts | ✅ |
docs/sidebars.js | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-country-map/CountryMap.stories.tsx | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-style/Theme.stories.tsx | ✅ |
docker/pythonpath_dev/superset_config.py | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-table/Table.stories.tsx | ✅ |
superset/migrations/versions/2020-09-28_17-57_b56500de1855_add_uuid_column_to_import_mixin.py | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-number-format/NumberFormat.stories.tsx | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-time-format/TimeFormat.stories.tsx | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Timeseries/Timeseries.stories.tsx | ✅ |
scripts/cancel_github_workflows.py | ✅ |
superset/queries/api.py | ✅ |
superset/db_engine_specs/couchbase.py | ✅ |
docs/src/pages/community.tsx | ✅ |
superset/db_engine_specs/duckdb.py | ✅ |
superset/db_engine_specs/snowflake.py | ✅ |
RELEASING/changelog.py | ✅ |
docs/docusaurus.config.ts | ✅ |
superset/sqllab/api.py | ✅ |
superset/dashboards/schemas.py | ✅ |
superset/db_engine_specs/databricks.py | ✅ |
docs/src/pages/index.tsx | ✅ |
superset/db_engine_specs/hive.py | ✅ |
superset/tags/api.py | ✅ |
superset/sql_lab.py | ✅ |
superset/migrations/versions/2022-04-01_14-38_a9422eeaae74_new_dataset_models_take_2.py | ✅ |
superset/charts/api.py | ✅ |
superset/datasets/api.py | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Need a new review? Comment
/korbit-review
on this PR and I'll review your latest changes.Korbit Guide: Usage and Customization
Interacting with Korbit
- You can manually ask Korbit to review your PR using the
/korbit-review
command in a comment at the root of your PR.- You can ask Korbit to generate a new PR description using the
/korbit-generate-pr-description
command in any comment on your PR.- Too many Korbit comments? I can resolve all my comment threads if you use the
/korbit-resolve
command in any comment on your PR.- Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
- Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.
Customizing Korbit
- Check out our docs on how you can make Korbit work best for you and your team.
- Customize Korbit for your organization through the Korbit Console.
Current Korbit Configuration
General Settings
Setting Value Review Schedule Automatic excluding drafts Max Issue Count 10 Automatic PR Descriptions ❌ Issue Categories
Category Enabled Documentation ✅ Logging ✅ Error Handling ✅ Readability ✅ Design ✅ Performance ✅ Security ✅ Functionality ✅ Feedback and Support
Note
Korbit Pro is free for open source projects 🎉
Looking to add Korbit to your team? Get started with a free 2 week trial here
declare module 'react-syntax-highlighter/dist/cjs/languages/hljs/markdown' { | ||
const language: any; | ||
export default language; | ||
} | ||
|
||
declare module 'react-syntax-highlighter/dist/cjs/languages/hljs/htmlbars' { | ||
const language: any; | ||
export default language; | ||
} | ||
|
||
declare module 'react-syntax-highlighter/dist/cjs/languages/hljs/sql' { | ||
const language: any; | ||
export default language; | ||
} | ||
|
||
declare module 'react-syntax-highlighter/dist/cjs/languages/hljs/json' { | ||
const language: any; | ||
export default language; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant language module declarations 
Tell me more
What is the issue?
Repeated module declarations with identical structure violate the DRY principle and make maintenance more difficult.
Why this matters
If the structure of these language modules needs to change in the future, developers would need to update multiple identical declarations, increasing the risk of inconsistencies and maintenance overhead.
Suggested change ∙ Feature Preview
Create a type helper or utility to declare language modules:
type HighlighterLanguage = { language: any };
function declareLanguageModule(name: string) {
return `declare module 'react-syntax-highlighter/dist/cjs/languages/hljs/${name}' {
const language: any;
export default language;
}`;
}
// Or use a string literal union type
type SupportedLanguages = 'markdown' | 'htmlbars' | 'sql' | 'json';
declare module 'react-syntax-highlighter/dist/cjs/languages/hljs/*' {
const language: any;
export default language;
}
💬 Chat with Korbit by mentioning @korbit-ai.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
SUMMARY
When running
pre-commit run --all-files
I was getting a TON of console noise, TS errors, lint errors, etc. This should tidy things up significantly, fixing all the errors, improving the eslint process for docs, and more.It also updates a couple of newer pre-commit hooks/linters to newer version, and makes changes accordingly.
One migration caught a hypothetical security issue, and that was addressed as well.
Frontend pre-commit jobs (prettier/eslint) now write fixes when run locally, so you can re-run and pass, but do not do this on CI, so they appropriately fail.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
Let's see if CI passes!
ADDITIONAL INFORMATION