Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
Signed-off-by: NilashishC <[email protected]>
  • Loading branch information
NilashishC committed Aug 1, 2023
1 parent 003e8f3 commit 1bf9efd
Show file tree
Hide file tree
Showing 24 changed files with 752 additions and 204 deletions.
125 changes: 125 additions & 0 deletions .config/dictionary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
COLORTERM
ESCDELAY
Kolkata
Lightbulbs
Mergeable
Regset
Representer
Rocannon's
SCAP
SIGTERM
Towncrier # Changelog generator
ansiblelint
apidoc
argname
argnames
argparser
argspec
argvalues
astimezone
autorefs
basesystem
caplog
cliconf # Ansible network cli abstraction plugin
codeclimate
colname
coltext
colval
commandline
copybutton
datadir
datarootdir
deflist
devel
doctree
dumpable
dunder
editables
extlinks
facelessuser
fedoraproject
fontawesome
fqcn
fromlist
headerlink
helpconfig
hostvars
hrefs
htmlproofer
httpapi
ignorespace
importables
inlinehilite
intersphinx
introspector
isatty
jsonschema
keepends
kegex # An action's regex
kegexes
lentext
levelname
libonig
lightbulbs
linenums
linkcheck
lintable
lintables
magiclink
maskables
maxsplit
mkdocs
mkdocstrings
moduleauthor
mqueue # https://github.com/ansible/ansible-runner/issues/984
myproject
netcommon # Ansible network collection, seen in tests and README
netconf
nitpicky
nonblocking
oldmask
oneline
onigurumacffi
opensearch
oxfordcomma
pageview
preclear
precommand
premanent
pullable
pymdown
pymdownx
redhatinsights
representer
returndocs
runtimes
scrollback
sectionauthor
setuptools # Used in _version.pyi
smartquotes
somevalue
statemachine
stripspaces
subaction
subschema
superfences
templatable
templated
templating
testhost
testname
topbar
tracebacks
truecolor
usefixtures
userbase
viewcode
volmount
workdir
xmss
SKEL
OKGREEN
ENDC
topdown
addopts
testpaths
15 changes: 13 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,22 @@ extend-exclude =
pip-wheel-metadata,
# adjacent venv
venv
# project tox directory
.tox

# IMPORTANT: avoid using ignore option, always use extend-ignore instead
# Completely and unconditionally ignore the following errors:
extend-ignore = F, E203

# Accessibility/large fonts and PEP8 unfriendly:
max-line-length = 100

# Allow certain violations in certain files:
# Please keep both sections of this list sorted, as it will be easier for others to find and add entries in the future
per-file-ignores =
# The following ignores have been researched and should be considered permanent
# each should be preceeded with an explanation of each of the error codes
# If other ignores are added for a specific file in the section following this,
# these will need to be added to that line as well.


# Count the number of occurrences of each error/warning code and print a report:
statistics = true
5 changes: 5 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[settings]
line_length=100
lines_after_imports=2
lines_between_types=1
profile=black
160 changes: 160 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
---
default_language_version:
# ensures that we get same behavior on CI(s) as on local machines
python: python3.10
exclude: >
(?x)^(
_readthedocs|
.tox
)$
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0"
hooks:
- id: prettier
# Original hook implementation is flaky due to *several* bugs described
# in https://github.com/prettier/prettier/issues/12364
# a) CI=1 needed to avoid incomplete output
# b) two executions are needed because --list-different works correctly
# only when run with --check as with --write the output will also
# include other entries and logging level cannot be used to keep only
# modified files listed (any file is listes using the log level,
# regardless if
# is modified or not).
# c) We avoid letting pre-commit pass each filename in order to avoid
# runing multiple instances in parallel. This also ensures that running
# prettier from the command line behaves identically with the pre-commit
# one. No real performance downsides.
# d) exit with the return code from list-different (0=none, 1=some)
# rather than the write (0=successfully rewrote files). pre-commit.ci
entry: env CI=1 bash -c "prettier --list-different . || ec=$? && prettier --loglevel=error --write . && exit $ec"
pass_filenames: false
args: []
additional_dependencies:
- prettier
- prettier-plugin-toml

- repo: https://github.com/psf/black.git
rev: 23.7.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.278"
hooks:
- id: ruff
args:
- "--exit-non-zero-on-fix"

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v6.31.0
hooks:
- id: cspell
name: Spell check with cspell

- repo: https://github.com/Lucas-C/pre-commit-hooks.git
rev: v1.5.1
hooks:
- id: remove-tabs

- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v4.4.0
hooks:
# Side-effects:
- id: trailing-whitespace
- id: check-merge-conflict
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: check-added-large-files
- id: fix-byte-order-marker
- id: check-case-conflict
- id: check-symlinks
- id: check-yaml
exclude: >
(?x)^
(
mkdocs.yml
)
$
- id: detect-private-key
# Heavy checks:
- id: check-ast
- id: debug-statements

- repo: https://gitlab.com/bmares/check-json5
# Allow json comments, trailing commas
# https://github.com/pre-commit/pre-commit-hooks/issues/395
rev: v1.0.0
hooks:
- id: check-json5

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.35.0
hooks:
- id: markdownlint
exclude: >
(?x)^
(
\.github/ISSUE_TEMPLATE/\w+|
docs/(
faq|
index|
)|
README|
src/ansible_navigator/data/(help|welcome)
)\.md
$
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell
# NOTE: dout is part of the stdout action regex
args: ["-L", "dout"]
# We exclude generated and external files as they are not directly under
# our control, so we cannot fix spelling in them.
exclude: >
(?x)^
(
tests/fixtures/integration/actions/.*\.json|
src/ansible_navigator/data/grammar/.*\.json
)
$
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.32.0
hooks:
- id: yamllint
args:
- --strict
types: [file, yaml]

- repo: https://github.com/PyCQA/flake8.git
rev: 6.0.0
hooks:
- id: flake8
language_version: python3
additional_dependencies:
- darglint
- flake8-docstrings # uses pydocstyle

- repo: https://github.com/asottile/pyupgrade
# keep it after flake8
rev: v3.9.0
hooks:
- id: pyupgrade
args: ["--py39-plus"]

- repo: https://github.com/pycqa/pylint.git
rev: v3.0.0a6
hooks:
- id: pylint
args:
- docs/
- src/
- tests/
additional_dependencies:
- jinja2
- jsonschema
pass_filenames: false
3 changes: 3 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ignore: |
.tox
.pre-commit-config.yaml
50 changes: 50 additions & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
dictionaryDefinitions:
- name: words
path: .config/dictionary.txt
addWords: true
dictionaries:
- bash
- networking-terms
- python
- words
- "!aws"
- "!backwards-compatibility"
- "!cryptocurrencies"
- "!cpp"
ignorePaths:
# All dot files in the root
- \.*
# This file
- cspell.config.yaml
# The docs requirements file
- docs/requirements.in
# Ignore licenses
- licenses/*
# The mypy configuration file
- mypy.ini
# The shared file for tool configuration
- pyproject.toml
# The setup file
- setup.cfg
# All grammar (text-mate) tokenization files
- src/ansible_navigator/data/grammar/*.json
# Theme files
- src/ansible_navigator/data/themes/*.json
# Anything in the vendored tokenization directory
- src/ansible_navigator/tm_tokenize/*
# requirements.txt is generated
- requirements.txt
# All fixture files in the tests directory
- tests/fixtures/integration/actions/**/*.json
# The tox configuration file
- tox.ini

ignoreRegExpList:
- "--\\w+" # ansible-navigator long CLI parameters
- "(window|_screen|win)\\.\\w+" # curses calls e.g. getyx
- "\\^.*$" # kegex regular expressions
- "ANSIBLE_\\w+" # ansible environment variables
- "curses\\.\\w+" # curses functions e.g. curses.doupdate
- "monkeypatch\\.\\w+" # monkeypatch functions e.g. monkeypatch.setenv
- "request\\.node\\.\\w+" # pytest request e.g. request.node.nodeid
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,9 @@ write_to = "src/ansible_creator/_version.py"
[tool.pylint]

[tool.pylint.format]
max-line-length = 100
max-line-length = 100

[tool.ruff]
# Allow lines to be as long as 120 characters.
line-length = 100
fix = true
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Jinja2==3.0.3
jsonschema
Jinja2==3.0.3
jsonschema
2 changes: 1 addition & 1 deletion src/ansible_creator/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""The ansible-creator application"""
"""The ansible-creator application."""
Loading

0 comments on commit 1bf9efd

Please sign in to comment.