Skip to content

Commit

Permalink
Remove mdformat (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored Aug 14, 2024
1 parent e5fb79b commit 4ba1e83
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ jobs:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN || secrets.GITHUB_TOKEN }} # note GITHUB_TOKEN automatically generated
labels: true # autolabel issues and PRs
python: true # format Python code and docstrings
markdown: true # format Markdown
prettier: true # format YAML
prettier: true # format YAML, JSON, Markdown and CSS
spelling: false # check spelling
links: false # check broken links
summary: true # print PR summary with GPT4 (requires 'openai_api_key' or 'openai_azure_api_key' and 'openai_azure_endpoint')
summary: true # print PR summary with GPT4o (requires 'openai_api_key')
openai_azure_api_key: ${{ secrets.OPENAI_AZURE_API_KEY }}
openai_azure_endpoint: ${{ secrets.OPENAI_AZURE_ENDPOINT }}
# openai_api_key: ${{ secrets.OPENAI_API_KEY }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Welcome to the [Ultralytics Actions](https://github.com/ultralytics/action) repo
Ultralytics Actions automatically applies formats, updates, and enhancements:

- **Python Code:** Using [Ruff](https://github.com/charliermarsh/ruff), a fast Python auto-formatter.
- **Markdown Files:** With [mdformat](https://github.com/executablebooks/mdformat), ensuring a consistent style in documentation.
- **Markdown Files:** With [Prettier](https://github.com/prettier/prettier), ensuring a consistent style in documentation.
- **Docstrings:** Utilizing [docformatter](https://github.com/myint/docformatter) for clean and standardized documentation comments.
- **Swift Code:** Formatting Swift files using `swift-format` to ensure consistent coding style across Swift projects. _(Requires `macos-latest` to run correctly.)_
- **Spell Check:** Employing [codespell](https://github.com/codespell-project/codespell) for catching common misspellings.
Expand Down Expand Up @@ -60,7 +60,7 @@ To use this action in your Ultralytics repository:
token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, do not modify
labels: true # autolabel issues and PRs
python: true # format Python code and docstrings
markdown: true # format Markdown and YAML
prettier: true # format YAML, JSON, Markdown and CSS
swift: true # format Swift code (requires 'macos-latest')
spelling: true # check spelling
links: true # check broken links
Expand Down
12 changes: 1 addition & 11 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ runs:
run: |
pip install -q \
ruff docformatter codespell tomli
# mdformat-gfm mdformat-frontmatter mdformat-mkdocs
shell: bash

# Python formatting ------------------------------------------------------------------------------------------------
Expand All @@ -117,20 +116,11 @@ runs:
shell: bash
continue-on-error: true

# Markdown formatting ----------------------------------------------------------------------------------------------
- name: Run Mdformat
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && inputs.markdown == 'true' && github.event.action != 'closed'
run: |
curl -s "https://raw.githubusercontent.com/ultralytics/actions/main/utils/update_markdown_code_blocks.py" | python -
# mdformat . --number --wrap no
# find . -name "*.md" ! -path "./docs/*" -exec mdformat --number --wrap no {} +
shell: bash
continue-on-error: true

# Prettier (JavaScript, JSX, Angular, Vue, Flow, TypeScript, CSS, HTML, JSON, GraphQL, Markdown, YAML) -------------
- name: Run Prettier
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && (inputs.prettier == 'true' || inputs.markdown == 'true') && github.event.action != 'closed'
run: |
curl -s "https://raw.githubusercontent.com/ultralytics/actions/main/utils/update_markdown_code_blocks.py" | python -
npm install --global prettier
# npx prettier --write "**/*.{js,jsx,ts,tsx,css,less,scss,json,md,mdx,yml,yaml,html,vue,svelte}"
npx prettier --write "**/*.{css,json,yml,yaml}"
Expand Down
4 changes: 2 additions & 2 deletions utils/autolabel_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def get_event_content() -> Tuple[int, str, str, str]:

# Check if this is a newly opened PR
if event_data["action"] == "opened":
print("New PR detected. Waiting for 60 seconds before fetching PR data...")
time.sleep(30)
print("New PR detected. Waiting 20s before fetching PR data...")
time.sleep(20)

# Fetch the latest PR data
latest_pr_data = get_github_data(f"pulls/{pr_number}")
Expand Down

0 comments on commit 4ba1e83

Please sign in to comment.