prettier-vscode icon indicating copy to clipboard operation
prettier-vscode copied to clipboard

prettier is not ignoring Docker folder

Open NanezX opened this issue 2 years ago • 3 comments

Summary

Hi everyone, hope you are all good.

Basically, we are using prettier on our project but it is not ignoring the docker folder. We can directly set out path and run the command like for ex npx prettier --check ./src and work nicely. But we have multiples folders and we want just run in the same example npx prettier --check ..

I already add the docker to .prettierignore file and doest work. I tried with docker, ./docker, docker/* and docker/**/* without success. The error it is because docker generate a data folder in docker/data (that we already ignore with .gitignore) and have higher permission.

user@user:~/repo$ npx prettier --check .
Checking formatting...
[error] Unable to expand directory: .
[error] EACCES: permission denied, scandir '/home/user/repo/docker/data/postgres'
All matched files use Prettier code style!

As you can see, we got All matched files use Prettier code style! but i it is looking inside the docker folder and showing that error.

Github Repository to Reproduce Issue

Link to a Github repo that can be used to reproduce the issue.

Steps To Reproduce:

  1. Install deps
  2. Run npx prettier --check .

Expected result

Ignore docker folder and succes prettier code style

Actual result

[error] Unable to expand directory: .
[error] EACCES: permission denied, scandir '/home/nanez/Terra virtua/rain-protocol-subgraph/docker/data/postgres'
All matched files use Prettier code style!

VS Code Version:

Version: 1.64.2 (user setup) Commit: f80445acd5a3dadef24aa209168452a3d97cc326 Date: 2022-02-09T22:02:28.252Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT x64 10.0.19043 Using WSL2: Ubuntu-20.04

Prettier Extension Version: v9.3.0

OS and version: Windows 10 - Using WSL2: Ubuntu-20.04

Prettier Log Output

This is the Log Output when running npx prettier --check .

["INFO" - 11:33:39 AM] Extension Name: esbenp.prettier-vscode.
["INFO" - 11:33:39 AM] Extension Version: 9.3.0.
["DEBUG" - 11:33:39 AM] Local prettier module path: '/home/nanez/Terra virtua/rain-protocol-subgraph/node_modules/prettier/index.js'
["DEBUG" - 11:33:40 AM] Using prettier version 2.5.1
["DEBUG" - 11:33:40 AM] Enabling Prettier globally
{
  "languageSelector": [
    {
      "language": "javascript"
    },
    {
      "language": "mongo"
    },
    {
      "language": "javascriptreact"
    },
    {
      "language": "typescript"
    },
    {
      "language": "typescriptreact"
    },
    {
      "language": "json"
    },
    {
      "language": "jsonc"
    },
    {
      "language": "json5"
    },
    {
      "language": "css"
    },
    {
      "language": "postcss"
    },
    {
      "language": "less"
    },
    {
      "language": "scss"
    },
    {
      "language": "handlebars"
    },
    {
      "language": "graphql"
    },
    {
      "language": "markdown"
    },
    {
      "language": "mdx"
    },
    {
      "language": "html"
    },
    {
      "language": "vue"
    },
    {
      "language": "yaml"
    },
    {
      "language": "ansible"
    },
    {
      "language": "home-assistant"
    },
    {
      "language": "jsonc",
      "scheme": "vscode-userdata"
    }
  ],
  "rangeLanguageSelector": [
    {
      "language": "javascript"
    },
    {
      "language": "javascriptreact"
    },
    {
      "language": "typescript"
    },
    {
      "language": "typescriptreact"
    },
    {
      "language": "json"
    },
    {
      "language": "graphql"
    },
    {
      "language": "handlebars"
    }
  ]
}
["DEBUG" - 11:33:40 AM] Enabling Prettier for Workspace /home/nanez/Terra virtua/rain-protocol-subgraph
{
  "languageSelector": [
    {
      "pattern": "/home/nanez/Terra virtua/rain-protocol-subgraph/**/*.{js,_js,bones,cjs,es,es6,frag,gs,jake,jsb,jscad,jsfl,jsm,jss,mjs,njs,pac,sjs,ssjs,xsjs,xsjslib,wxs,js.flow,jsx,ts,mts,cts,tsx,json,avsc,geojson,gltf,har,ice,JSON-tmLanguage,mcmeta,tfstate,tfstate.backup,topojson,webapp,webmanifest,yy,yyp,jsonc,sublime-build,sublime-commands,sublime-completions,sublime-keymap,sublime-macro,sublime-menu,sublime-mousemap,sublime-project,sublime-settings,sublime-theme,sublime-workspace,sublime_metrics,sublime_session,json5,css,wxss,pcss,postcss,less,scss,handlebars,hbs,graphql,gql,graphqls,md,markdown,mdown,mdwn,mkd,mkdn,mkdown,ronn,scd,workbook,mdx,component.html,html,htm,html.hl,inc,xht,xhtml,mjml,vue,yml,mir,reek,rviz,sublime-syntax,syntax,yaml,yaml-tmlanguage,yaml.sed,yml.mysql}",
      "scheme": "file"
    },
    {
      "language": "javascript"
    },
    {
      "language": "mongo"
    },
    {
      "language": "javascriptreact"
    },
    {
      "language": "typescript"
    },
    {
      "language": "typescriptreact"
    },
    {
      "language": "json"
    },
    {
      "language": "jsonc"
    },
    {
      "language": "json5"
    },
    {
      "language": "css"
    },
    {
      "language": "postcss"
    },
    {
      "language": "less"
    },
    {
      "language": "scss"
    },
    {
      "language": "handlebars"
    },
    {
      "language": "graphql"
    },
    {
      "language": "markdown"
    },
    {
      "language": "mdx"
    },
    {
      "language": "html"
    },
    {
      "language": "vue"
    },
    {
      "language": "yaml"
    },
    {
      "language": "ansible"
    },
    {
      "language": "home-assistant"
    },
    {
      "language": "jsonc",
      "scheme": "vscode-userdata"
    }
  ],
  "rangeLanguageSelector": [
    {
      "language": "javascript"
    },
    {
      "language": "javascriptreact"
    },
    {
      "language": "typescript"
    },
    {
      "language": "typescriptreact"
    },
    {
      "language": "json"
    },
    {
      "language": "graphql"
    },
    {
      "language": "handlebars"
    }
  ]
}
["DEBUG" - 11:34:01 AM] Local prettier module path: '/home/nanez/Terra virtua/rain-protocol-subgraph/node_modules/prettier/index.js'
["DEBUG" - 11:34:01 AM] Using prettier version 2.5.1

NanezX avatar Mar 03 '22 15:03 NanezX

I still have the same problem.

x6ax6b avatar Jul 18 '22 07:07 x6ax6b

I also have this issue, but with mongodb's directory.

AurumTheEnd avatar Jul 24 '22 11:07 AurumTheEnd

I have the same issue, with a postgres folder.

salvgrd avatar Aug 11 '22 17:08 salvgrd

Same problem. Here's a workaround npx prettier . --check '!./pgdata', where pgdata is a docker-postgres volume folder. Or if pgdata is located in a subdir: '!./**/pgdata'.

dj-mc avatar Nov 15 '22 08:11 dj-mc

This issue has been labeled as stale due to inactivity. Reply to keep this issue open.

github-actions[bot] avatar Apr 22 '23 14:04 github-actions[bot]

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Jul 30 '23 00:07 github-actions[bot]