Skip to content

Commit

Permalink
Add a few more nice to have hooks
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Algarvio <[email protected]>
  • Loading branch information
s0undt3ch committed Feb 7, 2023
1 parent de0070b commit 6c81943
Show file tree
Hide file tree
Showing 889 changed files with 2,217 additions and 2,322 deletions.
1 change: 0 additions & 1 deletion .mention-bot
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@
"skipTitle": "Merge forward",
"userBlacklist": ["cvrebert", "markusgattol", "olliewalsh", "basepi"]
}

41 changes: 41 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,50 @@
---
default_language_version:
python: python3

exclude: ^(doc/_static/.*|doc/_themes/.*)$
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- id: trailing-whitespace # Trims trailing whitespace.
args:
- --markdown-linebreak-ext=md
exclude: >
(?x)^(
pkg/macos/pkg-resources/.*\.rtf
)$
- id: mixed-line-ending # Replaces or checks mixed line ending.
args:
- --fix=lf
- id: end-of-file-fixer # Makes sure files end in a newline and only a newline.
- id: check-ast # Simply check whether files parse as valid python.
exclude: >
(?x)^(
templates/.*
)$
- id: check-case-conflict # Check for files with names that would conflict on a
# case-insensitive filesystem like MacOS HFS+ or Windows FAT.
- id: check-json # Attempts to load all json files to verify syntax.
- id: check-symlinks # Checks for symlinks which do not point to anything.
- id: debug-statements # Check for debugger imports and py37+ breakpoint() calls in python source.
exclude: >
(?x)^(
templates/.*
)$
- id: fix-byte-order-marker # removes UTF-8 byte order marker
- id: forbid-submodules # forbids any submodules in the repository.
- id: fix-encoding-pragma # Remove `# -*- coding: utf-8 -*-` from the top of python files.
args:
- --remove
exclude: >
(?x)^(
salt/ext/.*
)$
- repo: https://github.com/s0undt3ch/python-tools-scripts
rev: "0.10.1"
hooks:
Expand Down
24 changes: 12 additions & 12 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ contributions! But your PR will be labeled ``Needs Testcase`` and
``Help Wanted`` until someone can get to write the tests/documentation.
Of course, if you have a desire but just lack the skill we are more than
happy to collaborate and help out! There's the `documentation working
group <https://saltstack.gitlab.io/open/docs/docs-hub/topics/home.html>`__
group <https://saltstack.gitlab.io/open/docs/docs-hub/topics/home.html>`__
and the `testing working group <https://github.com/saltstack/community/tree/master/working_groups/wg-Testing>`__.
We also regularly stream our test clinic `live on
Twitch <https://www.twitch.tv/saltprojectoss>`__ every Tuesday afternoon
Expand All @@ -289,53 +289,53 @@ the ``salt/doc`` folder for documentation. Sphinx is used to generate the
documentation, and does require ``imagemagick``. See `Set up imagemagick`_ for
more information.

Before submitting a documentation PR, it helps to first build the Salt docs
Before submitting a documentation PR, it helps to first build the Salt docs
locally on your machine and preview them. Local previews helps you:

- Debug potential documentation output errors before submitting a PR.
- Saves you time by not needing to use the Salt CI/CD test suite to debug, which takes
more than 30 minutes to run on a PR.
- Ensures the final output looks the way you intended it to look.

To set up your local environment to preview the core Salt and module
To set up your local environment to preview the core Salt and module
documentation:

#. Install the documentation dependencies. For example, on Ubuntu:

::

sudo apt-get update

sudo apt-get install -y enchant-2 git gcc imagemagick make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev xz-utils inkscape

#. Navigate to the folder where you store your Salt repository and remove any
#. Navigate to the folder where you store your Salt repository and remove any
`.nox` directories that might be in that folder:

::

rm -rf .nox

#. Install `pyenv` for the version of Python needed to run the docs. As of the
#. Install `pyenv` for the version of Python needed to run the docs. As of the
time of writing, the Salt docs theme is not compatible with Python 3.10, so
you'll need to run 3.9 or earlier. For example:

::

pyenv install 3.7.15
pyenv virtualenv 3.7.15 salt-docs
echo 'salt-docs' > .python-version

#. Activate `pyenv` if it's not auto-activated:

::

pyenv exec pip install -U pip setuptools wheel

#. Install `nox` into your pyenv environment, which is the utility that will
build the Salt documentation:

::

pyenv exec pip install nox


Expand All @@ -346,7 +346,7 @@ with this one-liner:

python -m nox -e 'docs-html(compress=False, clean=False)'; cd doc/_build/html; python -m webbrowser http://localhost:8000/contents.html; python -m http.server

The first time you build the docs, it will take a while because there are a
The first time you build the docs, it will take a while because there are a
*lot* of modules. Maybe you should go grab some dessert if you already finished
that sandwich. But once nox and Sphinx are done building the docs, python should
launch your default browser with the URL
Expand Down Expand Up @@ -581,7 +581,7 @@ When you open your PR, a reviewer will get automatically assigned. If
your PR is submitted during the week you should be able to expect some
kind of communication within that business day. If your tests are
passing and we're not in a code freeze, ideally your code will be merged
that week or month. If you haven't heard from your assigned reviewer, ping them
that week or month. If you haven't heard from your assigned reviewer, ping them
on GitHub, `irc <https://web.libera.chat/#salt>`__, or Community Slack.

It's likely that your reviewer will leave some comments that need
Expand Down
52 changes: 26 additions & 26 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,54 +41,54 @@

About Salt
==========
Built on Python, Salt is an event-driven automation tool and framework to
deploy, configure, and manage complex IT systems. Use Salt to automate common
infrastructure administration tasks and ensure that all the components of your
Built on Python, Salt is an event-driven automation tool and framework to
deploy, configure, and manage complex IT systems. Use Salt to automate common
infrastructure administration tasks and ensure that all the components of your
infrastructure are operating in a consistent desired state.

Salt has many possible uses, including configuration management, which involves:

* Managing operating system deployment and configuration.
* Installing and configuring software applications and services.
* Managing servers, virtual machines, containers, databases, web servers,
* Managing servers, virtual machines, containers, databases, web servers,
network devices, and more.
* Ensuring consistent configuration and preventing configuration drift.

Salt is ideal for configuration management because it is pluggable,
customizable, and plays well with many existing technologies. Salt enables you
to deploy and manage applications that use any tech stack running on nearly any
`operating system <https://docs.saltproject.io/salt/install-guide/en/latest/topics/salt-supported-operating-systems.html>`_,
including different types of network devices such as switches and routers from a
Salt is ideal for configuration management because it is pluggable,
customizable, and plays well with many existing technologies. Salt enables you
to deploy and manage applications that use any tech stack running on nearly any
`operating system <https://docs.saltproject.io/salt/install-guide/en/latest/topics/salt-supported-operating-systems.html>`_,
including different types of network devices such as switches and routers from a
variety of vendors.

In addition to configuration management Salt can also:

* Automate and orchestrate routine IT processes, such as common required tasks
* Automate and orchestrate routine IT processes, such as common required tasks
for scheduled server downtimes or upgrading operating systems or applications.
* Create self-aware, self-healing systems that can automatically respond to
* Create self-aware, self-healing systems that can automatically respond to
outages, common administration problems, or other important events.


About our sponsors
==================
Salt powers VMware's `vRealize Automation SaltStack Config`_, and can be found
under the hood of products from Juniper, Cisco, Cloudflare, Nutanix, SUSE, and
Salt powers VMware's `vRealize Automation SaltStack Config`_, and can be found
under the hood of products from Juniper, Cisco, Cloudflare, Nutanix, SUSE, and
Tieto, to name a few.

The original sponsor of our community, SaltStack, was `acquired by VMware in 2020 <https://www.vmware.com/company/acquisitions/saltstack.html>`_.
The Salt Project remains an open source ecosystem that VMware supports and
contributes to. VMware ensures the code integrity and quality of the Salt
modules by acting as the official sponsor and manager of the Salt project. Many
of the core Salt Project contributors are also VMware employees. This team
carefully reviews and enhances the Salt modules to ensure speed, quality, and
contributes to. VMware ensures the code integrity and quality of the Salt
modules by acting as the official sponsor and manager of the Salt project. Many
of the core Salt Project contributors are also VMware employees. This team
carefully reviews and enhances the Salt modules to ensure speed, quality, and
security.


Download and install Salt
=========================
Salt is tested and packaged to run on CentOS, Debian, RHEL, Ubuntu, MacOS,
Windows, and more. Download Salt and get started now. See
`supported operating systems <https://docs.saltproject.io/salt/install-guide/en/latest/topics/salt-supported-operating-systems.html>`_
Windows, and more. Download Salt and get started now. See
`supported operating systems <https://docs.saltproject.io/salt/install-guide/en/latest/topics/salt-supported-operating-systems.html>`_
for more information.

To download and install Salt, see:
Expand All @@ -100,8 +100,8 @@ Technical support
=================
Report bugs or problems using Salt by opening an issue: `<https://github.com/saltstack/salt/issues>`_

To join our community forum where you can exchange ideas, best practices,
discuss technical support questions, and talk to project maintainers, join our
To join our community forum where you can exchange ideas, best practices,
discuss technical support questions, and talk to project maintainers, join our
Slack workspace: `Salt Project Community Slack`_


Expand Down Expand Up @@ -137,11 +137,11 @@ refer to the `SECURITY.md`_ file found in this repository.

Join our community
==================
Salt is built by the Salt Project community, which includes more than 3,000
contributors working in roles just like yours. This well-known and trusted
community works together to improve the underlying technology and extend Salt by
creating a variety of execution and state modules to accomplish the most common
tasks or solve the most important problems that people in your role are likely
Salt is built by the Salt Project community, which includes more than 3,000
contributors working in roles just like yours. This well-known and trusted
community works together to improve the underlying technology and extend Salt by
creating a variety of execution and state modules to accomplish the most common
tasks or solve the most important problems that people in your role are likely
to face.

If you want to help extend Salt or solve a problem with Salt, you can join our
Expand Down
1 change: 0 additions & 1 deletion SUPPORT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ guidelines for filing bug reports:
**SaltStack Support** - If you need dedicated, prioritized support, please
consider a SaltStack Support package that fits your needs:
`<http://www.saltstack.com/support>`_

2 changes: 1 addition & 1 deletion changelog/59439.changed
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Improve support for listing macOS brew casks
Improve support for listing macOS brew casks
2 changes: 1 addition & 1 deletion changelog/59917.removed
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Remove and deprecate the __orchestration__ key from salt.runner and salt.wheel return data. To get it back, set features.enable_deprecated_orchestration_flag master configuration option to True. The flag will be completely removed in Salt 3008 Argon.
Remove and deprecate the __orchestration__ key from salt.runner and salt.wheel return data. To get it back, set features.enable_deprecated_orchestration_flag master configuration option to True. The flag will be completely removed in Salt 3008 Argon.
2 changes: 1 addition & 1 deletion changelog/60430.added
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Added ability for `salt.wait_for_event` to handle `event_id`s that have a list value.
Added ability for `salt.wait_for_event` to handle `event_id`s that have a list value.
2 changes: 1 addition & 1 deletion changelog/60722.added
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Added .0 back to our versioning scheme for future versions (e.g. 3006.0)
Added .0 back to our versioning scheme for future versions (e.g. 3006.0)
2 changes: 1 addition & 1 deletion changelog/60915.fixed
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Fixed parsing new format of terraform states in roster.terraform
Fixed parsing new format of terraform states in roster.terraform
2 changes: 1 addition & 1 deletion changelog/61727.fixed
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Fix SoftLayer configuration not raising an exception when a domain is missing
Fix SoftLayer configuration not raising an exception when a domain is missing
2 changes: 1 addition & 1 deletion changelog/62220.fixed
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Added EndeavourOS to the Arch os_family.
Added EndeavourOS to the Arch os_family.
2 changes: 1 addition & 1 deletion changelog/62281.fixed
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Fix Salt Package Manager (SPM) exception when calling spm create_repo .
Fix Salt Package Manager (SPM) exception when calling spm create_repo .
1 change: 0 additions & 1 deletion changelog/62578.added
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Adds __env__substitution to ext_pillar.stack; followup of #61531, improved exception handling for stacked template (jinja) template rendering and yaml parsing in ext_pillar.stack

2 changes: 1 addition & 1 deletion changelog/62624.fixed
Original file line number Diff line number Diff line change
@@ -1 +1 @@
updated rest_cherry/app to properly detect arg sent as a string as curl will do when only one arg is supplied.
updated rest_cherry/app to properly detect arg sent as a string as curl will do when only one arg is supplied.
2 changes: 1 addition & 1 deletion changelog/62761.added
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Added "connected_devices" feature to netbox pillar module. It contains extra information about devices connected to the minion
Added "connected_devices" feature to netbox pillar module. It contains extra information about devices connected to the minion
2 changes: 1 addition & 1 deletion changelog/63050.changed
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
netapi_enable_clients option to allow enabling/disabling of clients in salt-api.
By default all clients will now be disabled. Users of salt-api will need
to update their master config to enable the clients that they use. Not adding
the netapi_enable_clients option with required clients to the master config will
the netapi_enable_clients option with required clients to the master config will
disable salt-api.
2 changes: 1 addition & 1 deletion changelog/63067.added
Original file line number Diff line number Diff line change
@@ -1 +1 @@
salt-cloud support IMDSv2 tokens when using 'use-instance-role-credentials'
salt-cloud support IMDSv2 tokens when using 'use-instance-role-credentials'
2 changes: 1 addition & 1 deletion cicd/golden-images.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,4 @@
"is_windows": "true",
"ssh_username": "Administrator"
}
}
}
1 change: 0 additions & 1 deletion cicd/kitchen_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,3 @@
- artifacts/
- .kitchen/
expire_in: 6 months

1 change: 0 additions & 1 deletion conf/roster
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
# sudo: True # Whether to sudo to root, not enabled by default
#web2:
# host: 192.168.42.2

8 changes: 4 additions & 4 deletions conf/suse/master
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,8 @@ syndic_user: salt
# variable_end_string: '}}'
# comment_start_string: '{#'
# comment_end_string: '#}'
# line_statement_prefix:
# line_comment_prefix:
# line_statement_prefix:
# line_comment_prefix:
# trim_blocks: False
# lstrip_blocks: False
# newline_sequence: '\n'
Expand All @@ -553,8 +553,8 @@ syndic_user: salt
# variable_end_string: '}}'
# comment_start_string: '{#'
# comment_end_string: '#}'
# line_statement_prefix:
# line_comment_prefix:
# line_statement_prefix:
# line_comment_prefix:
# trim_blocks: False
# lstrip_blocks: False
# newline_sequence: '\n'
Expand Down
2 changes: 1 addition & 1 deletion doc/_incl/extend_with_require_watch.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. admonition:: Using extend with require or watch

The ``extend`` statement works differently for ``require`` or ``watch``.
It appends to, rather than replacing the requisite component.
It appends to, rather than replacing the requisite component.
2 changes: 1 addition & 1 deletion doc/_incl/grains_passwords.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
Grains can be set by users that have access to the minion configuration files on
the local system, making them less secure than other identifiers in Salt. Avoid
storing sensitive data, such as passwords or keys, on minions. Instead, make
use of :ref:`pillar` and/or :ref:`sdb`.
use of :ref:`pillar` and/or :ref:`sdb`.
2 changes: 1 addition & 1 deletion doc/_incl/jinja_security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
:ref:`Jinja <understanding-jinja>` supports a `secure, sandboxed template execution environment
<https://jinja.palletsprojects.com/en/2.11.x/sandbox/>`__ that Salt
takes advantage of. Other text :ref:`renderers` do not support this
functionality, so Salt highly recommends usage of ``jinja`` / ``jinja|yaml``.
functionality, so Salt highly recommends usage of ``jinja`` / ``jinja|yaml``.
6 changes: 3 additions & 3 deletions doc/_incl/requisite_incl.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
**Before continuing** make sure you have a working Salt installation by
following the instructions in the
following the instructions in the
`Salt install guide <https://docs.saltproject.io/salt/install-guide/en/latest/>`_.

.. admonition:: Stuck?

The Salt Project community can help offer advice and help troubleshoot
The Salt Project community can help offer advice and help troubleshoot
technical issues as you're learning about Salt. One of the best places to
talk to the community is on the
talk to the community is on the
`Salt Project Slack workspace <https://saltstackcommunity.slack.com/>`_.
2 changes: 1 addition & 1 deletion doc/_templates/autosummary.rst.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
{{ underline }}

.. automodule:: {{ fullname }}
:members:
:members:
1 change: 0 additions & 1 deletion doc/cheatsheet/salt.tex
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,3 @@

\end{multicols}
\end{document}

1 change: 0 additions & 1 deletion doc/gen_gource
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
#
#
gource -1280x720 -s 0.5 --stop-at-end --hide filenames --highlight-all-users --file-filter po -a 5 --camera-mode overview --disable-progress --disable-bloom --output-ppm-stream - --output-framerate 30 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libvpx -b 10000K gource.webm

Loading

0 comments on commit 6c81943

Please sign in to comment.