Skip to content

Commit

Permalink
doc: add .gitattributes for md files
Browse files Browse the repository at this point in the history
PR-URL: #52161
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
huseyinacacak-janea authored and aduh95 committed Apr 29, 2024
1 parent 20c07e9 commit 4d577fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ deps/npm/bin/npm text eol=lf
deps/npm/bin/npx text eol=lf
deps/corepack/shims/corepack text eol=lf
tools/msvs/find_python.cmd text eol=crlf
doc/**/*.md text eol=lf
14 changes: 10 additions & 4 deletions vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ set lint_js=
set lint_cpp=
set lint_md=
set lint_md_build=
set format_md=
set i18n_arg=
set download_arg=
set build_release=
Expand Down Expand Up @@ -122,6 +123,7 @@ if /i "%1"=="lint-md" set lint_md=1&goto arg-ok
if /i "%1"=="lint-md-build" set lint_md_build=1&goto arg-ok
if /i "%1"=="lint" set lint_cpp=1&set lint_js=1&set lint_md=1&goto arg-ok
if /i "%1"=="lint-ci" set lint_cpp=1&set lint_js_ci=1&goto arg-ok
if /i "%1"=="format-md" set format_md=1&goto arg-ok
if /i "%1"=="package" set package=1&goto arg-ok
if /i "%1"=="msi" set msi=1&set licensertf=1&set download_arg="--download=all"&set i18n_arg=full-icu&goto arg-ok
if /i "%1"=="build-release" set build_release=1&set sign=1&goto arg-ok
Expand Down Expand Up @@ -180,6 +182,9 @@ if "%target_env%"=="vs2022" set "node_gyp_exe=%node_gyp_exe% --msvs_version=2022
:: skip building if the only argument received was lint
if "%*"=="lint" if exist "%node_exe%" goto lint-cpp

:: skip building if the only argument received was format-md
if "%*"=="format-md" if exist "%node_exe%" goto format-md

if "%config%"=="Debug" set configure_flags=%configure_flags% --debug
if defined nosnapshot set configure_flags=%configure_flags% --without-snapshot
if defined nonpm set configure_flags=%configure_flags% --without-npm
Expand Down Expand Up @@ -653,6 +658,7 @@ if "%ERRORLEVEL%"=="0" set "NODEJS_MAKE=make PYTHON=python" & goto run-make-lint
where wsl > NUL 2>&1
if "%ERRORLEVEL%"=="0" set "NODEJS_MAKE=wsl make" & goto run-make-lint
echo Could not find GNU Make, needed for linting C/C++
echo Alternatively, you can use WSL
goto lint-js

:run-make-lint
Expand All @@ -677,7 +683,7 @@ echo "Deprecated no-op target 'lint_md_build'"
goto lint-md

:lint-md
if not defined lint_md goto exit
if not defined lint_md goto format-md
echo Running Markdown linter on docs...
SETLOCAL ENABLEDELAYEDEXPANSION
set lint_md_files=
Expand All @@ -688,10 +694,10 @@ for /D %%D IN (doc\*) do (
)
%node_exe% tools\lint-md\lint-md.mjs %lint_md_files%
ENDLOCAL
goto exit
goto format-md

:format-md
if not defined lint_md goto exit
if not defined format_md goto exit
echo Running Markdown formatter on docs...
SETLOCAL ENABLEDELAYEDEXPANSION
set lint_md_files=
Expand All @@ -711,7 +717,7 @@ set exit_code=1
goto exit

:help
echo vcbuild.bat [debug/release] [msi] [doc] [test/test-all/test-addons/test-doc/test-js-native-api/test-node-api/test-internet/test-tick-processor/test-known-issues/test-node-inspect/test-check-deopts/test-npm/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [ignore-flaky] [static/dll] [noprojgen] [projgen] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [nonpm] [nocorepack] [ltcg] [licensetf] [sign] [ia32/x86/x64/arm64] [vs2022] [download-all] [enable-vtune] [lint/lint-ci/lint-js/lint-md] [lint-md-build] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [cctest] [no-cctest] [openssl-no-asm]
echo vcbuild.bat [debug/release] [msi] [doc] [test/test-all/test-addons/test-doc/test-js-native-api/test-node-api/test-internet/test-tick-processor/test-known-issues/test-node-inspect/test-check-deopts/test-npm/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [ignore-flaky] [static/dll] [noprojgen] [projgen] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [nonpm] [nocorepack] [ltcg] [licensetf] [sign] [ia32/x86/x64/arm64] [vs2022] [download-all] [enable-vtune] [lint/lint-ci/lint-js/lint-md] [lint-md-build] [format-md] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [cctest] [no-cctest] [openssl-no-asm]
echo Examples:
echo vcbuild.bat : builds release build
echo vcbuild.bat debug : builds debug build
Expand Down

0 comments on commit 4d577fa

Please sign in to comment.