When you have a "default" config file in your project's root folder (e.g. a pyproject.toml file) and you provide a different config file in your CLI command (e.g. --configuration .djlintrc), the former will always override the latter. According to the docs this should not be the case:
Command line args will always override any settings in pyproject.toml.
I've found a possible cause of this: in the load_project_settings function there isn't a return after the provided config path has been loaded, causing the default paths to be checked, which will override the provided config.
How To Reproduce
Create two config files (pyproject.toml and .djlintrc) with different configuration (e.g. only add extend_exclude to the .djlintrc file) and run the following command:
djlint --configuration .djlintrc
The command will ignore the extend_exclude settings from .djlintrc.
Contents of .djlintrc/pyproject.toml [tool.djlint]
System Info
3.8.16
)1.34.1
)Issue
When you have a "default" config file in your project's root folder (e.g. a
pyproject.toml
file) and you provide a different config file in your CLI command (e.g.--configuration .djlintrc
), the former will always override the latter. According to the docs this should not be the case:I've found a possible cause of this: in the
load_project_settings
function there isn't a return after the provided config path has been loaded, causing the default paths to be checked, which will override the provided config.How To Reproduce
Create two config files (
pyproject.toml
and.djlintrc
) with different configuration (e.g. only addextend_exclude
to the.djlintrc
file) and run the following command:The command will ignore the
extend_exclude
settings from.djlintrc
.Contents of .djlintrc/pyproject.toml [tool.djlint]
pyproject.toml
.djlintrc