Giter Club home page Giter Club logo

gisrep's Introduction

Hi there ๐Ÿ‘‹

I'm Sam, just another nerd.

I really enjoy tinkering with software. You can see some discussion at my neglected blog: sambriggs.dev.

I get a real kick out of someone opening a PR on one of my projects, so don't be shy!

Sam's GitHub stats

Top Langs

gisrep's People

Contributors

briggysmalls avatar

Stargazers

 avatar

Watchers

 avatar  avatar

gisrep's Issues

init --force should not overwrite template dir

Currently if the credentials need updating the only option is to use gisrep init --force.
However this will obliterate any existing config.
The semantics of 'init' would indicate that this is correct, but it is also annoying to lose any template directories that have been added in the even you entered your password wrong/token expired.

Make project open-source friendly

The project should be able to be developed by the open source community. To do so, some of the following might be necessary:

  • Add linter
  • Add CONTRIBUTING.md /.rst
  • Define testing strategy

Cleanup on uninstall

The tool creates the .gisreprc file in the home directory, and adds a password to the password manager.

These things should be cleaned up if the package is uninstalled.

Handle credentials/config better

  • There should be an explanation that you need a Github personal auth token in place of password for private repositories
  • There should be an option to specify a config file via the command line
  • There should be an option to pass credentials via the command line

Setup project

The project is missing the following fundamental project requirements:

  • Create README
  • Create licence
  • Add long_description

Use alternative keyring backend for travis

In order to nicely test the tool, a different keyring backend should be chosen for test completeness (it is proving very difficult to use dbus/gnome-keyring on travis/headless systems - despite getting very close)

It should also be confirmed that non-headless Linux systems can use keyring fine. I got close on an Ubuntu VM following the relevant section in the keyring README.

Add custom errors and improve handling

Currently the software uses the RuntimeError exception for all failures. This could be replaced with some custom errors, e.g.:

  • GisrepError

Furthermore the stack trace is listed, which is fairly confusing, rather than displaying to the user the correct CLI action to take (e.g. run gisrep init)

Remove support for template logic

After playing with the jinja2 I realise it is pretty powerful.

Using macros and calls, repeated logic (e.g. filters on for loops) can be made reusable, giving a lot of power to manipulate the issues handed to the template.

It is also possible to map, select, groupby attributes etc.

The complexity of the tool is far reduced if the 'look for python file with same name' feature is removed The addition of custom templates is made simpler too.

Add coverage tests

It is too easy to add features and not update tests appropriately.

A coverage checker should be integrated with Github

Check format was run on CI

Currently the format command can be executed using tox, however it is not run on the CI server.

Format should be run and any differences in the source should cause the build to fail

Add documentation

Currently modules, functions and classes are all missing documentation.
These should be added (and required/enforced by the linter #2)

Allow user to provide jinja2 environment configuration

Templates will appear differently based upon the jinja2 environment configuration.

For example, trim_blocks may or may not be desireable. Furthermore a template might benefit from the do statement introduced by the jinja2.ext.do extension.

A CLI option could be added to pass some kind of configuration to the jinja2 environment object created.

Review CLI

I'm still not happy with the CLI. I am now thinking:

  • Query: positional argument. Required.
  • Template: Named argument. Optional. Defaults to simple_report.md
  • Output: Named argument. Optional. Defaults to stdout
gisrep report [-h] query [--template TEMPLATE [TEMPLATE ...]] [--output OUTPUT [OUTPUT ...]]

I do think there is still an issue with how the help text is printed for multi-argument(s) for output (and potentially templates). It makes it look like multiple OUTPUTs can be provided, when it might make more sense to show something like:

gisrep report [-h] query [--template TEMPLATE [T-ARG-1 ...]] [--output OUTPUT [O-ARG-1 ...]]

Perhaps this can be done with some configuration of argparse.

Add 'sort' and 'order' CLI arguments

The search API for issues takes three parameters:

  • q (query)
  • sort
  • order

Currently only the query can be provided by the user on the CLI, and passed to PyGithub. The sort and order options should be added too.

Make it possible to add external templates & outputs

Currently the templates and outputs submodules contain the bundled templates and outputs. However the design was to allow a user to add their own externally-defined custom templates/outputs.

This approach should be implemented via the CLI and tested. This might either allow a user to specify a path of a template/output instance as an argument to the report command, or alternatively a directory could be added using the templates or outputs command.

Update MANIFEST.in

Currently the MANIFEST.in refers to LICENSE.txt when in fact the file is called LICENSE.

Remove outputs

The more I think about it, the less I feel it is gisrep's responsibility to offer different outputs. A command line tool should do one thing well. Thus gisrep should:

  • fetch issues
  • format them nicely
  • print them out

You can save to a file easily on many OSs:

gisrep report simple_report.md "repo:twbs/bootstrap is:open label:feature" > myfile.md

On macOS you can copy to the clipboard with pbcopy:

gisrep report simple_report.md "repo:twbs/bootstrap is:open label:feature" | pbcopy

Reevaluate setuptools dependency

Is it reasonable to want to define everything in setup.cfg? This is forcing a very new version of setuptools on anyone building the project.

I suppose it is OK. But perhaps the assertion in setup.py could be updated to give a better failure message. Adding a prompt to run:

pip install setuptools --upgrade

would be pretty helpful

Do not require init for public repos

The PyGithub Github class does not require credentials to be instantiated, and the search API does not require credentials to search public repositories.

Therefore the config file should be optional, and gisrep init should not be required to be run prior to using the tool.

Document tests

Tests should be documented like source code - e.g. fixtures can be printed with pytest and docstrings are used to describe them.

Pylint should probably be applied to the tests to enforce this. This likely requires an init.py file in the tests directory.

Templates missing on pypi

Setup.py does not specify the template files (.tplt) as part of the package, thus the distributed 0.1.0 version has no templates.

Setup.py must be updated to bundle the template files as module data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.