* Add linesep configuration option
Platform independent line ends are important to avoid conflicts.
Resolves: #1010
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
* Perform atomic write to files
Do not overwrite file as we may corrupt the file if something fails, instead
write into temporary location and move the result into the final destination.
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
* Synchronize README command-line usage
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
* Support files as positional argument
Tools such as pre-commit and other tools expects the tools to accept the
input files as positional argument and not as options.
Let's support the two variants.
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
* Support shallow git clone without tags
pre-commit uses shallow clone without tags, as this is not used to publish the
artifact, let's assume version '0' in this case.
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
* Add pre-commit hooks support
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
---------
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
* Fixing reporting of version when installed from git working copy.
Once VSG was installed from a git repo, the version would not update due to the version_info.py file being present.
Code was updated to handle this case,
* Removing trailing whitespace.
* Removing unused import.
Changing format of version when installing.
1) zip files with have the format: 3.0.0+zip.file
2) python setup.py install: 3.0.0.dev346
3) pip install: 3.0.0
Fixing version reporting with Git SHA.
1) Updating functions to version.py
a) get_git_sha
b) get_git_branch
2) Updated setup.py
a) Uses/generates file vsg/version_info.py depending on if it exists
NOTES:
version.py attempts to pull the latest version information from vsg/version_info.py.
If it exists it will use the version and sha in the file.
If it does not exist, version.py will pull the git sha from the local git repo.
When installing using setup.py, if the vsg/version_info.py exists then the version and sha in the file will be used.
If the file does not exist, then setup.py will pull the branch and sha from the git repo and build a unique version.
When requesting version using master, it would report the previous released version.
It would also report the SHA of the GIT repository it was currently executing in.
Both of these issues make it unclear which version of VSG you are using.
This update provides
1) Defaulting version to 'master'
2) Defaulting SHA to NA
The goal will be to hardcode the version and SHA when releasing to PYPI.
Adding commit SHA output to version option.
The SHA will only be reported if the git repo has been cloned.
When installed via PIP, the SHA will not be reported.