Skip to content

Commit

Permalink
Add (failing) node_modules test
Browse files Browse the repository at this point in the history
  • Loading branch information
raxod502 committed May 27, 2024
1 parent 833afa3 commit d08f233
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 2 deletions.
1 change: 1 addition & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
disable=SC2148
10 changes: 9 additions & 1 deletion test/formatters/apheleia-ft.el
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,15 @@ directory."
apheleia-ft--temp-dir
"^\\(in\\|out\\)\\."))
(unless (string= fname new-file)
(delete-file fname))))))
(delete-file fname)))
(let ((init-script (expand-file-name ".apheleia-ft.bash"
apheleia-ft--temp-dir)))
(when (file-exists-p init-script)
(let ((default-directory (file-name-directory init-script)))
(unless (zerop
(call-process
"bash" nil nil nil init-script))
(error "init script failed: %S" init-script))))))))

(defun apheleia-ft--path-join (component &rest components)
"Join COMPONENT and COMPONENTS together, left to right.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Behavior differs between 2.x and 3.x
// https://prettier.io/blog/2023/07/05/3.0.0.html
call(
@dec
class {},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Behavior differs between 2.x and 3.x
// https://prettier.io/blog/2023/07/05/3.0.0.html
call(
(
@dec
class {}
)
);

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "apheleia-ft-prettier-test-uses-node-modules",
"version": "1.0.0",
"description": "Prettier should be used from node_modules",
"main": "index.js",
"author": "Radian LLC <contact+apheleia@radian.codes>",
"license": "MIT",
"private": true,
"dependencies": {
"prettier": "^2.8.8"
}
}
2 changes: 1 addition & 1 deletion test/shared/run-func.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ exec emacs --batch -L . "$@" \
--eval "(setq debug-on-error t)" \
--eval "(setq backtrace-line-length 0)" \
-f "${func}" \
2>&1 | sed -uE 's/^(.{640}).+$/\1...[truncated]/'
2>&1 | sed -uE 's/^(.{320}).+$/\1...[truncated]/'

0 comments on commit d08f233

Please sign in to comment.