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

Doesn't work with Dockerfile.* #6

Open
b0o opened this issue Jun 17, 2023 · 1 comment
Open

Doesn't work with Dockerfile.* #6

b0o opened this issue Jun 17, 2023 · 1 comment

Comments

@b0o
Copy link

b0o commented Jun 17, 2023

When there's a need to have multiple Dockerfiles in a single directory, it's relatively common to name them Dockerfile.*, e.g. Dockerfile.dev, Dockerfile.prod.

I've tried configuring dprint to match such files, but it doesn't seem to work:

{
  "dockerfile": {},
  "includes": [
    "**/Dockerfile",
    "**/Dockerfile.*"
  ],
  "excludes": [],
  "plugins": [
    "https://plugins.dprint.dev/dockerfile-0.3.0.wasm"
  ]
}

If I have Dockerfile and Dockerfile.prod at the root of my project, running dprint output-file-paths finds Dockerfile but not Dockerfile.prod. It doesn't even work if I explicitly add **/Dockerfile.prod to includes.

If I add **/*.Dockerfile to includes and mv Dockerfile.prod prod.Dockerfile, it does find the file, but this isn't our preferred naming convention.

dprint-plugin-dockerfile version: 0.3.0

@UnknownPlatypus
Copy link

@b0o I believe you can simply add an association key to your config to make dprint format files matching your specific glob with the docker plugin.

{
  "dockerfile": {
    "associations": ["**/Dockerfile.*"]
  },
  "excludes": [],
  "plugins": [
    "https://plugins.dprint.dev/dockerfile-0.3.0.wasm"
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants