Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

danielebra
Copy link

Added documentation to demonstrate how to integrate djlint and efm for neovim formatting.

This tool has some quirks such as returning non-zero status codes when successfully formatting a file, which makes chaining this tool into other tools more challenging. This configuration snippet takes those quirks into consideration to correctly integrate with efm and allowing for smooth buffer updates when reformatting a django template.

image

@netlify
Copy link

netlify bot commented Mar 21, 2025

Deploy Preview for djlint ready!

Name Link
🔨 Latest commit 3c5ba14
🔍 Latest deploy log https://app.netlify.com/sites/djlint/deploys/67dcc5742f7e160008efb158
😎 Deploy Preview https://deploy-preview-1197--djlint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@monosans monosans requested a review from Copilot July 29, 2025 13:30
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds documentation for integrating djlint with the efm-languageserver for Neovim users. The integration handles djlint's quirk of returning non-zero exit codes even when successfully formatting files.

  • Added a new section explaining efm-languageserver integration with step-by-step setup instructions
  • Provided a complete sample Lua configuration for efm-languageserver
  • Included specific djlint command flags to handle the tool's unique behavior with exit codes

Comment on lines +111 to +120
0. Install djlint with Mason via `:MasonInstall djlint`
1. Add `htmldjango` to `filetypes`
2. Create format configuration
```
local djlint = {
formatCommand = "djlint --reformat --quiet --warn -",
formatStdin = true,
}
```
3. Connect language to formatter with `htmldjango = {djlint}`
Copy link

Copilot AI Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The numbering starts with '0' which is unconventional for step-by-step instructions. Consider starting with '1' for better readability and consistency with typical documentation conventions.

Suggested change
0. Install djlint with Mason via `:MasonInstall djlint`
1. Add `htmldjango` to `filetypes`
2. Create format configuration
```
local djlint = {
formatCommand = "djlint --reformat --quiet --warn -",
formatStdin = true,
}
```
3. Connect language to formatter with `htmldjango = {djlint}`
1. Install djlint with Mason via `:MasonInstall djlint`
2. Add `htmldjango` to `filetypes`
3. Create format configuration

local djlint = {
formatCommand = "djlint --reformat --quiet --warn -",
formatStdin = true,
}

4. Connect language to formatter with `htmldjango = {djlint}`

Copilot uses AI. Check for mistakes.

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

Successfully merging this pull request may close these issues.

1 participant