Skip to content

Rule 15 sometimes flags incorrect locations #195

@SecondSkoll

Description

@SecondSkoll

Describe the bug
On testing against the Enterprise Store documentation, I encountered an issue where the linter was raising a warning in the wrong location.

To Reproduce
Text sample:

```bash
#!/bin/bash

set -eu

# PostgreSQL connection string to the Enterprise Store database.
POSTGRESQL_CONN_STRING="${POSTGRESQL_CONN_STRING}"

tar xvzf offline-snap-store.tar.gz
cd offline-snap-store
sudo ./install.sh

sudo enterprise-store config proxy.db.connection="$POSTGRESQL_CONN_STRING"

sudo enterprise-store enable-airgap-mode

sudo enterprise-store status
```

If the registered store's location was an HTTPS one, follow the
[HTTPS setup](security.md) instructions to configure the TLS certificate.

## Brand store metadata import


```
$ store-admin export store \
    --arch=amd64 --arch=arm64 \
    --channel=stable --channel=edge \
    --key=keyId1 --key=keyId2 \
    myDeviceViewStoreID

Logging in as store admin...
Opening an authorization web page in your browser.
If it does not open, please open this URL:
 https://api.jujucharms.com/identity/login?did=idxyz


...

Creating the export archive...
Store data exported to: /home/ubuntu/snap/store-admin/common/export/store-export-myDeviceViewStoreID-20220527T082652.tar.gz
```

Output is:

 test.md
 8:25  warning  Avoid using prompts in code     Canonical.015-No-prompts-in-comments 
                blocks: $    

Expected behavior
Should flag line 28, not line 8.

Remediation
Might be fixed by capturing more than just the starting character? ^[ \t]*[$%] \w+

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions