Skip to content
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

test: flag crlf line endings #44

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/pr-check-lint_content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ jobs:

files_to_lint="$DIFF_DOCUMENTS"

echo "crlf line ending check"
CRLF_FAILED=true
git ls-files --eol ${files_to_lint}
CRLF_LOG=$(git ls-files --eol ${files_to_lint} | grep -E 'w/(mixed|crlf)') || CRLF_FAILED=false
echo "CRLF_LOG<<${EOF}" >> $GITHUB_ENV
echo "${CRLF_LOG}" >> $GITHUB_ENV
echo "${EOF}" >> $GITHUB_ENV
echo "CRLF_FAILED=${CRLF_FAILED}" >> $GITHUB_ENV

echo "Running markdownlint --fix"
MD_LINT_FAILED=false
MD_LINT_LOG=$(yarn markdownlint-cli2 --fix ${files_to_lint} 2>&1) || MD_LINT_FAILED=true
Expand Down Expand Up @@ -114,6 +123,7 @@ jobs:
fi

# info for troubleshooting
echo CRLF_FAILED=${CRLF_FAILED}
echo MD_LINT_FAILED=${MD_LINT_FAILED}
echo FM_LINT_FAILED=${FM_LINT_FAILED}
echo PRETTIER_FAILED=${PRETTIER_FAILED}
Expand Down Expand Up @@ -154,17 +164,24 @@ jobs:
-reporter="github-pr-review"

- name: Fail if any issues pending
if: ${{ env.FILES_MODIFIED == 'true' || env.MD_LINT_FAILED == 'true' || env.FM_LINT_FAILED == 'true' }}
if: ${{ env.FILES_MODIFIED == 'true' || env.MD_LINT_FAILED == 'true' || env.FM_LINT_FAILED == 'true' || env.CRLF_FAILED == 'true' || env.PRETTIER_FAILED == 'true' }}
env:
CRLF_FAILED: ${{ env.CRLF_FAILED }}
MD_LINT_FAILED: ${{ env.MD_LINT_FAILED }}
FM_LINT_FAILED: ${{ env.FM_LINT_FAILED }}
PRETTIER_FAILED: ${{ env.PRETTIER_FAILED }}
CRLF_LOG: ${{ env.CRLF_LOG }}
MD_LINT_LOG: ${{ env.MD_LINT_LOG }}
FM_LINT_LOG: ${{ env.FM_LINT_LOG }}
PRETTIER_LOG: ${{ env.PRETTIER_LOG }}
run: |
echo -e "\nPlease fix all the linting issues mentioned in the following logs and in the PR review comments."

if [[ ${CRLF_FAILED} == 'true' ]]; then
echo -e "\n\n🪵 In the following files make sure all the lines ends with 'lf' character and not 'crlf' characters:"
echo "${CRLF_LOG}"
fi

if [[ ${MD_LINT_FAILED} == 'true' ]]; then
echo -e "\n\n🪵 Logs from markdownlint:"
echo "${MD_LINT_LOG}"
Expand Down
26 changes: 26 additions & 0 deletions files/en-us/games/test/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: UIEvent:sourceCapabilities 属性
slug: games/sourceCapabilities
l10n:
sourceCommit: 8cac4a3fed6a702840efd2deda67a922120732d0
OnkarRuikar marked this conversation as resolved.
Show resolved Hide resolved
---

{{APIRef("Input Device Capabilities API")}}{{SeeCompatTable}}

{{domxref("UIEvent")}} 接口的 **`sourceCapabilities `** 只读属性返回 {{domxref('InputDeviceCapabilities')}} 接口的一个实例,该实例提供有关负责生成触摸事件的物理设备的信息。如果没有输入设备对事件负责,则返回 `null`。
OnkarRuikar marked this conversation as resolved.
Show resolved Hide resolved

当单个用户与输入设备的交互生成一系列不同的输入事件时,所有这些事件的 `sourceCapabilities` 属性将指向 `InputDeviceCapabilities` 的同一个实例。例如,当用户将手指从触摸屏上抬起时,可能会生成若干个 UIEvent,包括 `touchend`、`mousedown`、`click` 和 `focus`。所有这些事件必须具有表示触摸屏的相同 `sourceCapabilities`。

只有当该交互是 Web 平台提供的抽象的一部分时,设备才被视为对事件“负责”。例如,许多用户代理允许使用鼠标或键盘调整窗口大小,但这个细节不会以任何方式暴露给 Web 平台,因此 resize 事件的 sourceCapabilities 通常为 null。
OnkarRuikar marked this conversation as resolved.
Show resolved Hide resolved

## 值
OnkarRuikar marked this conversation as resolved.
Show resolved Hide resolved

{{domxref('InputDeviceCapabilities')}} 的实例。

## 规范
OnkarRuikar marked this conversation as resolved.
Show resolved Hide resolved

{{Specifications}}

## 浏览器兼容性
OnkarRuikar marked this conversation as resolved.
Show resolved Hide resolved

{{Compat}}
2 changes: 2 additions & 0 deletions files/en-us/web/html/element/summary/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ browser-compat: html.elements.summary

The **`<summary>`** [HTML](/en-US/docs/Web/HTML) element specifies a summary, caption, or legend for a {{HTMLElement("details")}} element's disclosure box. Clicking the `<summary>` element toggles the state of the parent `<details>` element open and closed.

Adding CRLF here ->

{{EmbedInteractiveExample("pages/tabbed/summary.html","tabbed-shorter")}}

## Attributes
Expand Down
6 changes: 6 additions & 0 deletions files/en-us/web/test/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: CRLF EOL Test
slug: Web/Test
---

Using `github.dev` to commit the file with `CRLF` EOL.
Loading