Commit a4a9e29
feat: Add ATMOS_PROFILE environment variable support and fix linter errors
## Profile Environment Variable Support
Added `ATMOS_PROFILE` environment variable support for setting active profiles:
- Added env var fallback in `internal/exec/cli_utils.go` for commands using ProcessCommandLineArgs
- Removed redundant env var handling from `cmd/root.go` (not used by most commands)
- Supports comma-separated profiles: `ATMOS_PROFILE="ci,developer"`
- Flag takes precedence over env var for consistent behavior
- Updated configuration documentation
## Linter Fixes
Fixed all lintroller and golangci-lint errors:
- Added missing `defer perf.Track()` in `pkg/flags/flag_parser.go:NormalizeShorthandWithEquals()`
- Fixed `Deprecated` field comment in `pkg/schema/schema.go` (removed colon to avoid deprecation marker)
- Removed unnecessary `os.Chdir` save/restore in `cmd/root_helpers_test.go` (tests don't change directory)
- Added `cmd/root_helpers_test.go` and `cmd/root_test.go` to lintroller exclusions for legitimate `os.Args` usage
(these files test functions that directly read `os.Args`)
## Testing
All changes tested and verified:
- ✅ `ATMOS_PROFILE=developer` loads profile correctly
- ✅ `--profile` flag works
- ✅ Flag precedence over env var
- ✅ Comma-separated profiles work
- ✅ All unit tests pass
- ✅ All linter checks pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 3e91960 commit a4a9e29
File tree
15 files changed
+44
-22
lines changed- cmd
- version
- docs/prd
- errors
- internal/exec
- pkg
- config
- flags
- schema
- tools/lintroller
- website/docs/cli/configuration
15 files changed
+44
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | 831 | | |
837 | 832 | | |
838 | 833 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
| 325 | + | |
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
| |||
135 | 134 | | |
136 | 135 | | |
137 | 136 | | |
| 137 | + | |
| 138 | + | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
141 | | - | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
670 | 671 | | |
671 | 672 | | |
672 | 673 | | |
673 | | - | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
674 | 678 | | |
675 | 679 | | |
676 | 680 | | |
677 | 681 | | |
678 | | - | |
| 682 | + | |
679 | 683 | | |
680 | 684 | | |
681 | | - | |
682 | 685 | | |
683 | 686 | | |
684 | 687 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | | - | |
| 544 | + | |
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
548 | | - | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
549 | 551 | | |
550 | 552 | | |
551 | 553 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
119 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
123 | 138 | | |
124 | 139 | | |
125 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
147 | 150 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
0 commit comments