Comments (8)
Sounds like a good idea. Not sure about precedence. I think for safety, it should be an error (or at least a highly visible warning) if the environment variable is set and the .adr-dir
file exists.
This would also address the issues raised in #51.
from adr-tools.
Thinking about this some more. Yes, an ADR_DIR environment variable sounds like a good idea (although I worry about environment variable name clash... is the name used by any other program?)
The advantage of the .adr-dir file over the environment variable is that it can be checked into version control, while the environment variable is local to each user's workstation
Precedence-wise, therefore, the .adr-dir file MUST take precedence over the environment variable, otherwise setting the environment variable would stop adr-tools working with existing projects. For the same reason, if the default ADR directory (doc/adr) already exists, that also must take precedence over the environment.
from adr-tools.
Isn't this a bit backwards with expectations though? One often uses an ENV var to override what's checked in of the default state; it allows easy switching of behaviour at the cli without having to edit files, move directories, etc. I think it would make sense to issue either a warning or error if there is a conflict but I would think that the main utility would be having the ADR_DIR
be the highest precedence.
from adr-tools.
I'm torn... I can see one way being error prone. And the other way being unusual (and therefore error prone in different ways).
A design goal is that all project config can be checked into version control. Maybe the conflict here is because an environment variable works against that goal.
from adr-tools.
Looking back at original use case reported in the issue, I think your first response makes the most sense - warn/puke if env var exists as well as .adr-dir and they don't match. Could also have a flag to suppress the warning/error.
If I had to guess, people will use it in an either-or sort of way - either have a checked in .adr-dir file, or use ENV vars to switch/specify based on their own custom setups. The appropriate documentation could even be written to suggest that users pick one way or the other, perhaps?
from adr-tools.
I think the rules should be the following pseudocode:
if ADR_DIR is set
if .adr-exists and the contents is different than $ADR_DIR or the directory doc/adr exists and $ADR_DIR != "doc/adr" then
fail
else
use $ADR_DIR
end
else
... current behaviour
end
from adr-tools.
This can easily be implemented by adding logic to the _adr_dir script.
from adr-tools.
from adr-tools.
Related Issues (20)
- ADR numbering sequence may break when merging multiple PRs HOT 1
- Possibility to rename ADR using cli
- Add a generator for a _Sidebar md to make github wiki a bit more useful
- Add basher config file
- Read config from setup.cfg?
- Custom ADR template? HOT 2
- bash: adr: command not found HOT 1
- Supper surprised different ADR status variables are not baked in from the start
- Update link in initial ADR
- Spelling mistake with SUPERCEDED HOT 1
- Was MADR support removed?
- Is there a way to localise this tool? HOT 1
- Support for i18n
- CMDer support for adr-tools HOT 2
- Content licensing? HOT 2
- .adr-dir as the root of a tree
- Overload template and direcotry file names with --arguments HOT 1
- Still maintained? HOT 19
- Central store to aggregate ADRs from multiple projects HOT 1
- Original blog post link nearly unvisitable in Chrome HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adr-tools.