Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter for Pyenv shellrc file named more descriptive #160

Merged
merged 2 commits into from
Jan 23, 2023
Merged

Parameter for Pyenv shellrc file named more descriptive #160

merged 2 commits into from
Jan 23, 2023

Conversation

MorganLindqvist
Copy link

The parameter pyenv_setting_path is changed to pyenv_shellrc_file, which actually is what it is.

Added logic to keep backwards compability as well as print a deprecation warning. After suitable time the warning can be changed into a fail.

Change-Id: Idf5a9420c8af521290244cc6f6d3829a71e4f07b
Change-Id: Ia4133e0824145a7263e0639b740a1ec92b1da84b
Copy link
Owner

@staticdev staticdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @MorganLindqvist for PR. I made two small suggestions based on syntax and lint checks for the changes you sent.

when: pyenv_setting_path is defined

- name: "Load pyenv env variables in {{ pyenv_shellrc_file }}"
ansible.builtin.lineinfile: dest="{{ pyenv_shellrc_file }}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind adding file permissions mode to this file? Ansible recommends explicits definition and in most cases I check what are the original permissions of the file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@staticdev This is not a row that I have added, only changed the name of the parameter. OK with any changes/improvements you would like to do in your code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@staticdev , looks like it would be quicker to approve this PR and then fix the issues in #161 . This PR does not introduce any new issues. The old ones are solved in #161 but that one needs github changes to make the automatic lint in github ehrn building the environment work.

- name: "Add pyenv autocomplete in {{ pyenv_setting_path }}"
ansible.builtin.lineinfile: dest="{{ pyenv_setting_path }}"
- name: "Add pyenv autocomplete in {{ pyenv_shellrc_file }}"
ansible.builtin.lineinfile: dest="{{ pyenv_shellrc_file }}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another small improvement for consistency is to not use free-form parameters for actions, also ansible-lint favors thuis sintax.

Instead of:

  ansible.builtin.lineinfile: dest="{{ pyenv_shellrc_file }}"
...

Use:

  ansible.builtin.lineinfile:
    dest: "{{ pyenv_shellrc_file }}"
...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@staticdev This is not a row that I have added, only changed the name of the parameter. OK with any changes/improvements you would like to do in your code.

Copy link
Author

@MorganLindqvist MorganLindqvist Jan 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@staticdev in the lint PR (#161 ) I fixed the above and all other lint warnings. When that one is merged I can rebase this. (or we can do it in the reverse order)

@staticdev staticdev merged commit a5f41bd into staticdev:main Jan 23, 2023
@staticdev
Copy link
Owner

staticdev commented Jan 23, 2023

I merged this one so you may need to rebase the other. Thanks again @MorganLindqvist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants