Skip to content

Commit 01252f1

Browse files
authored
Format .md, .json, .yaml files using prettier (mlflow#7429)
* Add config Signed-off-by: harupy <[email protected]> * Format .md, .json, .yaml files using prettier Signed-off-by: harupy <[email protected]> * Format JS files Signed-off-by: harupy <[email protected]> * Ignore failure Signed-off-by: harupy <[email protected]> Signed-off-by: harupy <[email protected]>
1 parent 8002df2 commit 01252f1

File tree

119 files changed

+12019
-1410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+12019
-1410
lines changed

.devcontainer/docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
version: '3'
1+
version: "3"
22
services:
33
mlflow:
4-
image: 'ghcr.io/mlflow/mlflow-devcontainer'
4+
image: "ghcr.io/mlflow/mlflow-devcontainer"
55
working_dir: /workspaces/mlflow
66
environment:
77
MLFLOW_HOME: /workspaces/mlflow

.github/ISSUE_TEMPLATE/bug_report_template.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Bug Report
22
description: Create a report to help us reproduce and correct the bug
3-
labels: 'bug'
4-
title: '[BUG]'
3+
labels: "bug"
4+
title: "[BUG]"
55

66
body:
77
- type: markdown

.github/ISSUE_TEMPLATE/doc_fix_template.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Documentation Fix
22
description: Use this template for proposing documentation fixes/improvements.
3-
labels: 'area/docs'
4-
title: '[DOC-FIX]'
3+
labels: "area/docs"
4+
title: "[DOC-FIX]"
55

66
body:
77
- type: markdown

.github/ISSUE_TEMPLATE/feature_request_template.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Feature Request
22
description: Use this template for feature and enhancement proposals.
3-
labels: 'enhancement'
4-
title: '[FR]'
3+
labels: "enhancement"
4+
title: "[FR]"
55

66
body:
77
- type: markdown

.github/ISSUE_TEMPLATE/installation_issue_template.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Installation Issues
22
description: Use this template for reporting bugs encountered while installing MLflow.
3-
labels: 'bug'
4-
title: '[SETUP-BUG]'
3+
labels: "bug"
4+
title: "[SETUP-BUG]"
55

66
body:
77
- type: markdown

.github/ISSUE_TEMPLATE/ui_bug_report_template.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: UI Bug Report
22
description: Create a report to help us reproduce and correct the UI bug
3-
labels: ['bug', 'area/uiux']
4-
title: '[BUG]'
3+
labels: ["bug", "area/uiux"]
4+
title: "[BUG]"
55

66
body:
77
- type: markdown

.github/actions/setup-java/action.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
name: 'setup-java'
2-
description: 'Set up Java'
1+
name: "setup-java"
2+
description: "Set up Java"
33
inputs:
44
java-version:
5-
description: 'java-version'
5+
description: "java-version"
66
default: 11
77
required: false
88

99
distribution:
10-
description: 'distribution'
10+
description: "distribution"
1111
default: adopt
1212
required: false
1313

1414
runs:
15-
using: 'composite'
15+
using: "composite"
1616
steps:
1717
- uses: actions/setup-java@v3
1818
with:

.github/actions/update-requirements/action.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
name: 'update-requirements'
2-
description: 'Update requirements YAML specifications and re-generate requirements text files'
1+
name: "update-requirements"
2+
description: "Update requirements YAML specifications and re-generate requirements text files"
33

44
outputs:
55
updated:
6-
description: 'Indicates whether the requirements have been updated'
6+
description: "Indicates whether the requirements have been updated"
77
value: ${{ steps.update-requirements.outputs.updated }}
88

99
runs:
10-
using: 'composite'
10+
using: "composite"
1111
steps:
1212
- name: Update requirements
1313
id: update-requirements

.github/pull_request_template.md

+8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Please reference any related feature requests, issues, or PRs here. For example,
1717
<!--
1818
If you're unsure about what to test, where to add tests, or how to run tests, please feel free to ask.
1919
-->
20+
2021
- [ ] Existing unit/integration tests
2122
- [ ] New unit/integration tests
2223
- [ ] Manual tests (describe details, including test results, below)
@@ -40,7 +41,9 @@ Please describe how you confirmed the proposed feature/bug-fix/change works here
4041
(Details in 1-2 sentences. You can just refer to another PR with a description if this PR is part of a larger change.)
4142

4243
### What component(s), interfaces, languages, and integrations does this PR affect?
44+
4345
Components
46+
4447
- [ ] `area/artifacts`: Artifact stores and artifact logging
4548
- [ ] `area/build`: Build and test infrastructure for MLflow
4649
- [ ] `area/docs`: MLflow documentation pages
@@ -54,17 +57,20 @@ Components
5457
- [ ] `area/tracking`: Tracking Service, tracking client APIs, autologging
5558

5659
Interface
60+
5761
- [ ] `area/uiux`: Front-end, user experience, plotting, JavaScript, JavaScript dev server
5862
- [ ] `area/docker`: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
5963
- [ ] `area/sqlalchemy`: Use of SQLAlchemy in the Tracking Service or Model Registry
6064
- [ ] `area/windows`: Windows support
6165

6266
Language
67+
6368
- [ ] `language/r`: R APIs and clients
6469
- [ ] `language/java`: Java APIs and clients
6570
- [ ] `language/new`: Proposals for new client languages
6671

6772
Integrations
73+
6874
- [ ] `integrations/azure`: Azure and Azure ML integrations
6975
- [ ] `integrations/sagemaker`: SageMaker integrations
7076
- [ ] `integrations/databricks`: Databricks integrations
@@ -74,7 +80,9 @@ Insert an empty named anchor here to allow jumping to this section with a fragme
7480
(e.g. https://github.com/mlflow/mlflow/pull/123#user-content-release-note-category).
7581
Note that GitHub prefixes anchor names in markdown with "user-content-".
7682
-->
83+
7784
<a name="release-note-category"></a>
85+
7886
### How should the PR be classified in the release notes? Choose one:
7987

8088
- [ ] `rn/breaking-change` - The PR will be mentioned in the "Breaking Changes" section

.github/stale.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ markComment: >
3939

4040
# Comment to post when closing a stale Issue or Pull Request.
4141
closeComment: >
42-
This issue has not been interacted with for 365 days since it was marked as stale! As such, the
43-
issue is now closed. If you have this issue or more information, please re-open the issue!
42+
This issue has not been interacted with for 365 days since it was marked as stale! As such, the
43+
issue is now closed. If you have this issue or more information, please re-open the issue!
4444
4545
# Limit the number of actions per hour, from 1-30. Default is 30
4646
limitPerRun: 30

.github/workflows/autoformat.js

+8-11
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ const getPullInformation = async (context, github) => {
2626
ref: head_ref,
2727
repo: { full_name },
2828
} = pr.data.head;
29-
const {
30-
sha: base_sha,
31-
ref: base_ref,
32-
} = pr.data.base;
29+
const { sha: base_sha, ref: base_ref } = pr.data.base;
3330
return {
3431
repository: full_name,
3532
pull_number,
@@ -47,26 +44,26 @@ const createReaction = async (context, github) => {
4744
owner,
4845
repo,
4946
comment_id,
50-
content: 'rocket',
47+
content: "rocket",
5148
});
5249
};
5350

5451
const createStatus = async (context, github, core) => {
5552
const { head_sha, head_ref, repository } = await getPullInformation(context, github);
56-
if (repository === 'mlflow/mlflow' && head_ref === 'master') {
57-
core.setFailed('Running autoformat bot against master branch of mlflow/mlflow is not allowed.');
53+
if (repository === "mlflow/mlflow" && head_ref === "master") {
54+
core.setFailed("Running autoformat bot against master branch of mlflow/mlflow is not allowed.");
5855
}
59-
await createCommitStatus(context, github, head_sha, 'pending');
56+
await createCommitStatus(context, github, head_sha, "pending");
6057
};
6158

6259
const updateStatus = async (context, github, sha, needs) => {
63-
const failed = Object.values(needs).some(({ result }) => result === 'failure');
64-
const state = failed ? 'failure' : 'success';
60+
const failed = Object.values(needs).some(({ result }) => result === "failure");
61+
const state = failed ? "failure" : "success";
6562
await createCommitStatus(context, github, sha, state);
6663
};
6764

6865
const isMlflowMaintainer = (commentAuthorAssociation) => {
69-
return ['OWNER', 'MEMBER', 'COLLABORATOR'].includes(commentAuthorAssociation);
66+
return ["OWNER", "MEMBER", "COLLABORATOR"].includes(commentAuthorAssociation);
7067
};
7168

7269
module.exports = {

.github/workflows/autoformat.yml

+5
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ jobs:
8080
git fetch origin ${{ needs.check-comment.outputs.base_ref }}
8181
git merge origin/${{ needs.check-comment.outputs.base_ref }}
8282
# ************************************************************************
83+
# Prettier
84+
# ************************************************************************
85+
- run: |
86+
pre-commit run prettier --all-files --color=always || true
87+
# ************************************************************************
8388
# protos
8489
# ************************************************************************
8590
- if: steps.diff.outputs.protos == 'true'

.github/workflows/closing-pr.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ const CLOSING_SYNTAX_PATTERNS = [
44
/(?:(?:close|fixe|resolve)[sd]?|fix)\s+(?:mlflow\/mlflow)?#(\d+)/gi,
55
/(?:(?:close|fixe|resolve)[sd]?|fix)\s+(?:https?:\/\/github.com\/mlflow\/mlflow\/issues\/)(\d+)/gi,
66
];
7-
const HAS_CLOSING_PR_LABEL = 'has-closing-pr';
7+
const HAS_CLOSING_PR_LABEL = "has-closing-pr";
88

99
const getIssuesToClose = (body) => {
10-
const commentsExcluded = body.replace(/<!--(.+?)-->/gs, ''); // remove comments
10+
const commentsExcluded = body.replace(/<!--(.+?)-->/gs, ""); // remove comments
1111
const matches = CLOSING_SYNTAX_PATTERNS.flatMap((pattern) =>
12-
Array.from(commentsExcluded.matchAll(pattern)),
12+
Array.from(commentsExcluded.matchAll(pattern))
1313
);
1414
const issueNumbers = matches.map((match) => match[1]);
1515
return [...new Set(issueNumbers)].sort();
@@ -30,32 +30,32 @@ const capitalizeFirstLetter = (string) => {
3030
};
3131

3232
const test = () => {
33-
['close', 'closes', 'closed', 'fix', 'fixes', 'fixed', 'resolve', 'resolves', 'resolved'].forEach(
33+
["close", "closes", "closed", "fix", "fixes", "fixed", "resolve", "resolves", "resolved"].forEach(
3434
(keyword) => {
35-
assertArrayEqual(getIssuesToClose(`${keyword} #123`), ['123']);
36-
assertArrayEqual(getIssuesToClose(`${capitalizeFirstLetter(keyword)} #123`), ['123']);
37-
},
35+
assertArrayEqual(getIssuesToClose(`${keyword} #123`), ["123"]);
36+
assertArrayEqual(getIssuesToClose(`${capitalizeFirstLetter(keyword)} #123`), ["123"]);
37+
}
3838
);
3939

4040
const body2 = `
4141
Fix mlflow/mlflow#123
4242
Resolve https://github.com/mlflow/mlflow/issues/456
4343
`;
44-
assertArrayEqual(getIssuesToClose(body2), ['123', '456']);
44+
assertArrayEqual(getIssuesToClose(body2), ["123", "456"]);
4545

4646
const body3 = `
4747
Fix #123
4848
Close #123
4949
`;
50-
assertArrayEqual(getIssuesToClose(body3), ['123']);
50+
assertArrayEqual(getIssuesToClose(body3), ["123"]);
5151

52-
const body4 = 'Relates to #123';
52+
const body4 = "Relates to #123";
5353
assertArrayEqual(getIssuesToClose(body4), []);
5454

55-
const body5 = '<!-- close #123 -->';
55+
const body5 = "<!-- close #123 -->";
5656
assertArrayEqual(getIssuesToClose(body5), []);
5757

58-
const body6 = 'Fixs #123 Fixd #456';
58+
const body6 = "Fixs #123 Fixd #456";
5959
assertArrayEqual(getIssuesToClose(body6), []);
6060
};
6161

@@ -66,7 +66,7 @@ if (require.main === module) {
6666

6767
module.exports = async ({ context, github }) => {
6868
const { body } = context.payload.pull_request;
69-
getIssuesToClose(body || '').forEach(async (issue_number) => {
69+
getIssuesToClose(body || "").forEach(async (issue_number) => {
7070
const { owner, repo } = context.repo;
7171
await github.rest.issues.addLabels({
7272
owner,

.github/workflows/dev-setup.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: Dev environment setup
33
on:
44
push:
55
paths:
6-
- 'dev/dev-env-setup.sh'
7-
- 'dev/test-dev-env-setup.sh'
8-
- '.github/workflows/dev-setup.yml'
6+
- "dev/dev-env-setup.sh"
7+
- "dev/test-dev-env-setup.sh"
8+
- ".github/workflows/dev-setup.yml"
99
schedule:
1010
- cron: "42 7 * * 0"
1111
workflow_dispatch:

0 commit comments

Comments
 (0)