203 Commits

Author SHA1 Message Date
Markus Reiter
480e264d9a
Lint Ruby docs. 2024-05-01 11:35:21 +02:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Douglas Eichelberger
794b839e36 Fix remaining YARD exception 2023-01-12 09:56:05 -08:00
Lukas Oberhuber
6fbadb35e7
Style fix
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2022-08-05 16:06:22 -07:00
Lukas Oberhuber
cd9fe97c55 Improve style 2022-07-30 11:10:26 +01:00
Lukas Oberhuber
22b1b61b73 Fix brew typecheck 2022-07-26 19:36:43 +01:00
Lukas Oberhuber
215e545660 brew style 2022-07-26 19:28:30 +01:00
Lukas Oberhuber
c2a95f077f Compiler -g flag set based on --debug-symbols 2022-07-26 17:18:01 +01:00
nandahkrishna
09febbf031
extend/ENV: make 'passphrase' sensitive
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-03-29 16:58:07 +05:30
Bo Anderson
65c03573c6
ENV: fix missing arg for generic OS and correct type sigs 2021-02-26 18:23:48 +00:00
Seeker
fbafaff4fe rubocop: require braces for Sorbet sig 2021-01-18 16:52:45 -08:00
Markus Reiter
0424940496 Add types for ENV extensions. 2020-11-23 02:06:37 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Mike McQuaid
f161e56ce0 ENV: check SDK exists when setting up.
Reuse code from `brew doctor` that checks and produces a fatal error
and from `install.rb` that runs it.

Closes #8646
2020-09-11 12:05:22 +01:00
Markus Reiter
276c570c16 Pass individual args explicitly to ENV extensions. 2020-07-28 02:52:45 +02:00
Markus Reiter
25b3632c4c Pass args to ENV instead of using global args. 2020-07-25 03:57:43 +02:00
Mike McQuaid
d5ff4f5327
Remove ARGV.env
Replace with `Homebrew.args.env`.

Part of #5730.
2020-05-23 13:49:38 +01:00
Cheng XU
66697d4290
ENV: add sensitive_environment function
ENV#sensitive_environment is used to list all sensitive environments.

Also refactor the code on determining whether an environment is sensitive.
2019-07-18 15:06:33 +08:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Alyssa Ross
84dda31e82
Add tests for ENV#clear_sensitive_environment! 2018-03-01 17:48:08 +00:00
Mike McQuaid
9358f678a3 Clear/mask passwords as well as tokens. 2017-11-07 07:54:34 +00:00
Mike McQuaid
cf5fdeef1d Rubocop: manual rule fixes. 2017-09-24 21:23:59 +01:00
Mike McQuaid
d02b4f321d Hide sensitive tokens from install/test/post.
Hide these tokens to avoid malicious subprocesses e.g. sending them
over the network. Also, support using these tokens with environment
filtering and clear `HOMEBREW_PATH` from subprocesses to stop them
sniffing it. Finally, use `HOMEBREW_PATH` to detect Homebrew’s user’s
PATH for e.g. `brew doctor` etc.
2017-04-22 16:31:19 +01:00
Mike McQuaid
416e51bca9 ENV: only check Superenv if necessary. (#451) 2016-07-06 10:43:42 +01:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Jack Nagel
6cdc76452b Only directories are candidates for superenv bin 2014-04-22 15:39:59 -05:00
Jack Nagel
722a5af4eb Simplify conditions for superenv activation
`MacOS::Xcode.without_clt? && MacOS.sdk_path.nil?` should never be true.

In its earliest form, this would raise a bare RuntimeError in an effort
to have the bug reported. Later, it was changed to silently disable
superenv. But we don't want to do that. If there's a bug, or the user's
system is misconfigured, we want to know, so that we can fix the bug, or
the user can fix their system. So let's remove the condition.
2014-04-22 15:37:34 -05:00
Jack Nagel
c7a54f8da1 Use ARGV.env 2014-03-13 16:37:11 -05:00
Jack Nagel
e0574b854e More robust implementation of ENV.with_build_environment 2013-08-19 12:32:59 -05:00
Jack Nagel
dd9c269c69 Rename HomebrewEnvExtension to Stdenv 2013-08-19 12:32:59 -05:00
Jack Nagel
9a5b15bb61 Move common ENV methods to a shared module 2013-08-19 12:32:59 -05:00
Jack Nagel
cc18f5e0c4 Move superenv.rb to extend/ENV/super.rb 2013-08-19 12:32:59 -05:00
Jack Nagel
ce31c16a14 Reference self, not ENV, in ENV.fortran 2013-08-19 12:32:58 -05:00
Jack Nagel
d09e23c8b1 Move extra stdenv setup to extended callback 2013-08-19 12:32:57 -05:00
Jack Nagel
eebc04ec9b Move common stuff to extend/ENV.rb 2013-08-19 12:32:57 -05:00
Jack Nagel
e998132406 This is a backreference, not an embedded NUL 2013-08-16 20:50:20 -05:00
Misty De Meo
1333b8d666 ENV.universal_binary: use as_arch_flags 2013-08-15 23:04:26 -07:00
Misty De Meo
ef1f2b4a79 Add Hardware::CPU.arch_(32|64)_bit
This replaces hardcoding of i386/x86_64 all over the code.
2013-08-15 22:46:55 -07:00
Adam Vandenberg
20986e3ff5 ENV: add usage note to ncurses_define 2013-08-05 14:47:02 -07:00
Jack Nagel
38c1d25036 Remove unreachable branch in ENV.fortran
Now that this is handled by a Requirement with a default formula, this
code cannot be triggered under normal circumstances.

The advice given has now been moved to the Formula Cookbook on the wiki.
2013-07-11 13:03:25 -05:00
Adam Vandenberg
aafe2f20d0 Add Fortran ENV helpers 2013-06-24 07:38:25 -07:00
Jack Nagel
5539c97191 Fix another constant reference 2013-06-14 11:49:00 -05:00
Jack Nagel
a463398a8b Fix constant reference 2013-06-14 11:09:53 -05:00
Jack Nagel
eee5a09202 Favor compound if over compound unless 2013-06-14 10:34:20 -05:00
Jack Nagel
9427704176 Use ||= instead of unless 2013-06-14 10:34:20 -05:00
Jack Nagel
e73f869d84 Remove outdated comment 2013-06-14 10:34:20 -05:00
Jack Nagel
381255adec Assign this inline 2013-06-14 10:34:19 -05:00
Jack Nagel
3252f9a2c9 Delete rather than assign nil 2013-06-14 10:34:19 -05:00