Git Product home page Git Product logo

Comments (3)

jcberquist avatar jcberquist commented on August 23, 2024

This is something I have wanted to do, I just haven't figured out how it should look/work. So thank you for suggesting it, as now I can get your input. :)

Currently, the default settings are used as a base, and then if cfformat.settings is set in the CommandBox config settings, that file is loaded and merged onto the base. Finally, if a path to settings is passed into the command, those settings are merged last.

I think a settings file passed inline to the command should win (be merged last), and I presume if the command looks for a settings file by convention (Where? Here I really need input, should it look for a settings file in the directory the command was run from? Should it climb the the directory tree, either from the target file/directory, or the CWD?) that would be used next to last. So I envision the order of settings to be:

  1. Base settings
  2. Settings file set in CommandBox config (cfformat.settings currently)
  3. Settings file found by convention based, in some fashion, on where command was run
  4. Settings file passed inline to the command

Does this make sense to you?

In addition, for the cfformat.settings config setting, I have been thinking about defaulting it to ~/cfformat.json so you can just create a settings file in your home directory and it will get picked up. (And then of course you could override that location by specifying the config setting explicitly.)

Incidentally, I noticed you suggested .cfformat.json - that was honestly my first thought for a settings file name, but really because I see the .settings.json used all over the place. I am inclined to it for that reason, but what is the rational for it?

from commandbox-cfformat.

elpete avatar elpete commented on August 23, 2024
  1. Base settings
  2. Settings file set in CommandBox config (cfformat.settings currently)
  3. Settings file found by convention based, in some fashion, on where command was run
  4. Settings file passed inline to the command

I agree with the order you specified for overriding settings. This is especially important because it allows a repo to store its format settings. I as a user can contribute to a repo and any discrepancies in format taste will be decided by the repo.

In addition, for the cfformat.settings config setting, I have been thinking about defaulting it to ~/cfformat.json so you can just create a settings file in your home directory and it will get picked up. (And then of course you could override that location by specifying the config setting explicitly.)

I think you have this covered with the CommandBox config setting.

Incidentally, I noticed you suggested .cfformat.json - that was honestly my first thought for a settings file name, but really because I see the .settings.json used all over the place. I am inclined to it for that reason, but what is the rational for it?

It seems to be the standard for configuration files in a repo to begin with a period (.). I was just following this convention.

from commandbox-cfformat.

jcberquist avatar jcberquist commented on August 23, 2024

I have added support for this. Let me know how it goes!

from commandbox-cfformat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.