Makefile target names

Marco Ceppi marco at ondina.co
Thu Jan 22 16:57:36 UTC 2015


We can also add Makefile checking to charm proof, for an even greater
redundancy.

To avoid multiple invocations of charm proof (not terrible, IMO) lint could
be broken down further:

lint: proof code_lint

proof:
    charm proof

code_lint:
    # Your code here

Then have bundle tester sniff out code_lint, or use the test.yaml
configuration to point lint to code_lint. Doesn't change UX for the
author/contributor but does add a level of complexity. It seems like
Makefile's are the overwhelming method for consolidating tasks for charms,
I'd like to kick off the following proposal for Makefile format to be
placed in charm create templates:

```
test: lint unit-test functional-test
lint: proof code-lint
sync: charm-helpers-sync

code-lint:
    # FILL IN COMMANDS FOR PERFORMING CODE LINT

unit-test:
   # COMMANDS REQUIRED TO UNIT TEST

charm-helpers-sync:
    @scripts/sync.py ....

functional-test:
    juju test

proof:
    charm proof
```

With a test.yml file that contained the following:

```
makefile:
    - code-lint
    - unit-test
```

And where applicable, add a .venv target for python charms and recommend
the use of having charm deps modeled in requirements.txt and pip installed
to that virtualenv.

Opinions, additions, concerns?

On Thu Jan 22 2015 at 11:41:56 AM Wes Mason <wesley.mason at canonical.com>
wrote:

> On 22 January 2015 at 16:36, Simon Davy <bloodearnest at gmail.com> wrote:
>
>>  On 22 January 2015 at 16:29, David Britton <david.britton at canonical.com>
>> wrote:
>> > On Thu, Jan 22, 2015 at 04:17:26PM +0000, Simon Davy wrote:
>> >> On 22 January 2015 at 15:13, David Britton <
>> david.britton at canonical.com> wrote:
>> >> >
>> >> > lint:
>> >> >  - make lint
>> >> >
>> >>
>> >> Could we also make[1] the charm linter lint the makefile for the
>> >> presence of targets agreed in the outcome of this thread?
>> >
>> > "charm proof"
>> >
>> > I like it.  (bundle tester already runs this)
>>
>> Which is interesting, as my lint targets general runs charm proof too,
>> so it'd be run twice in that case?
>>
>> Not a big issue, but if the charm store/review queue is automatically
>> charm-proofing too, perhaps the make lint target should not be?
>>
>> --
>> Simon
>>
>>
> Whelp it's still nice to have as part of lint when developing the charm,
> and charm-proof isn't exactly the slowest process to run multiple times.
>
> --
> Juju mailing list
> Juju at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/juju
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20150122/e7250feb/attachment.html>


More information about the Juju mailing list