geerlingguy / geerlingguy/ansible-for-devops
Unnecessary conditional block on page 155 (is_blue function)
Open
- Dominant language
- Python
- Stars
- 9.9k
- Forks
- 3.8k
- PR merge metrics
- No merged PRs in 30d
Description
```python
if string in blue_values:
return True
else:
return False
```
could be replaced by
```python
return string in blue_values
```
I feel it looks simpler and better that way, the conditional block is not necessary there.
Cheers, loving the book so far!
Contributor guide
No contributing guide indexed for this repository
Research direction
Review the is_blue function shown on page 155 and confirm the existing conditional block is the target. Replace it with the direct membership return, then verify that the function still returns the expected result for values in and outside blue_values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Refactor
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100