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

Refactor test and lint to use templated command #225

Open
novopl opened this issue Sep 22, 2019 · 0 comments
Open

Refactor test and lint to use templated command #225

novopl opened this issue Sep 22, 2019 · 0 comments
Assignees
Labels
Projects
Milestone

Comments

@novopl
Copy link
Owner

novopl commented Sep 22, 2019

What?

docs:
  path: docs
  command:
    sphinx-refdoc  \
      -i src/peltak \
      -i src/peltak_appengine \
      -i src/peltak_django \
      -i src/cliform \
      \
      {opts.verbosity | count_flag('-v')} \
      docs/ref; \
    sphinx-build \
      -b html \
      -d {cfg.build_dir}/docs \
      docs
      docs/html


checks:
  - name: Check static types
    command: mypy {files}
  - name: PEP8 compliance
    command: pycodestyle --config ops/tools/pep8.ini {files}
  - name: Static code checks
    command: pylint --rc-file ops/tools/pylint.ini {files}


tests:
  unit: |
    pytest -c ops/tools/pytest.ini \
      --cov-config=ops/tools/coverage.ini \
      --cov={cfg.src_dir} \
      --cov-report=term \
      --cov-report=html:.build/coverage \
      --junitxml={cfg.build_dir}/test-results.xml
      --full-trace
      -vvv
      test/unit

Why?

Pros:
  • It could greatly simplify the peltak code base
  • Could be way more flexible
  • Makes you remember the actual tool commands
Cons:
  • You have to write the command yourself, peltak won't help you with that (less beginner friendly).

How?

It could be implemented using jinja2 for the command templates. The template rendering doesn't have to be super fast because it only happens when the actual command is ran and that will take much more time to execute.

The command template should be injected with a standardized environment that contains everything needed (options, conf, filters, etc.).

The base code for that can be developed when working on the scripts.

@novopl novopl added this to the 1.0 milestone Sep 22, 2019
@novopl novopl added the feature label Sep 22, 2019
@novopl novopl self-assigned this Sep 22, 2019
@novopl novopl added this to Capture in 1.0 Dec 26, 2020
@novopl novopl moved this from Capture to Released in 1.0 Dec 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
1.0
  
Released
Development

No branches or pull requests

1 participant