doc updates

This commit is contained in:
Manuel Barkhau 2020-10-03 20:03:59 +00:00
parent 14115a2791
commit 179208cf30
4 changed files with 36 additions and 49 deletions

View file

@ -8,12 +8,15 @@
- Better support for optional parts. - Better support for optional parts.
- New: Start `BUILD` parts at `1000` to avoid leading zero truncation. - New: Start `BUILD` parts at `1000` to avoid leading zero truncation.
- New gitlab #2: Added `grep` subcommand to find and debug patterns. - New gitlab #2: Added `grep` subcommand to find and debug patterns.
- New: Added better error messages to debug regular expressions.
- New gitlab #10: `--pin-date` to keep date parts unchanged, and only increment non-date parts. - New gitlab #10: `--pin-date` to keep date parts unchanged, and only increment non-date parts.
- New add `--release-num` to increment the `alphaN`/`betaN`/`a0`/`b0`/etc. release number - New: Added `--release-num` to increment the `alphaN`/`betaN`/`a0`/`b0`/etc. release number
- New: Added `--date=<iso-date>` parameter to set explicit date (instead of current date).
- Fix gitlab #8: Push tags only pushed tags, not actual commit. - Fix gitlab #8: Push tags only pushed tags, not actual commit.
- Fix gitlab #9: Make commit message configurable. - Fix gitlab #9: Make commit message configurable.
- Fix gitlab #11: Show regexp when `--verbose` is used. - Fix gitlab #11: Show regexp when `--verbose` is used.
- Fix: Disallow `--release=dev` which has different semantics than other release tags. - Fix: Disallow `--release=dev` which has different semantics than other release tags.
- Fix: Entries in `file_patterns` were ignored if there were multiple for the same file.
- Switch main repo from gitlab to github. - Switch main repo from gitlab to github.

View file

@ -77,7 +77,7 @@ $ cd myproject
~/myproject/ ~/myproject/
$ pycalver init --dry $ pycalver init --dry
WARNING - File not found: pycalver.toml WARNING - File not found: pycalver.toml
Exiting because of '--dry'. Would have written to pycalver.toml: Exiting because of '-d/--dry'. Would have written to pycalver.toml:
[pycalver] [pycalver]
current_version = "v202010.1001-alpha" current_version = "v202010.1001-alpha"
@ -541,7 +541,7 @@ The steps performed by `bump` are:
5. *Tag* the new commit. 5. *Tag* the new commit.
6. *Push* the new commit and tag. 6. *Push* the new commit and tag.
Again, you can use `--dry` to inspect the changes first. Again, you can use `-d/--dry` to inspect the changes first.
``` ```
$ pycalver bump --dry $ pycalver bump --dry
@ -597,12 +597,13 @@ TODO: Descriptions
| CLI Argument | Description | | CLI Argument | Description |
|------------------|-------------| |------------------|-------------|
| --major | | | --major | |
| -m --minor | | | -m/--minor | |
| -p --patch | | | -p/--patch | |
| -r --release-num | | | -r/--release-num | |
| --date | |
| --pin-date | | | --pin-date | |
| --no-fetch | | | -n/--no-fetch | |
| --dry | | | -d/--dry | |
| --allow-dirty | | | --allow-dirty | |

View file

@ -63,37 +63,20 @@ The recommended approach to using `pylint-ignore` is:
``` ```
## File src/pycalver/config.py - Line 275 - W0511 (fixme) ## File src/pycalver/__main__.py - Line 419 - W0511 (fixme)
- `message: TODO (mb 2020-09-18): Validate Pattern`
- `author : Manuel Barkhau <mbarkhau@gmail.com>`
- `date : 2020-09-18T19:04:06`
```
251: def _parse_config(raw_cfg: RawConfig) -> Config:
...
273: raise ValueError(f"Invalid week number pattern: {version_pattern}")
274:
> 275: # TODO (mb 2020-09-18): Validate Pattern
276: # detect YY with WW or UU -> suggest GG with VV
277: # detect YYMM -> suggest YY0M
```
## File src/pycalver/__main__.py - Line 317 - W0511 (fixme)
- `message: TODO (mb 2020-09-18): Investigate error messages` - `message: TODO (mb 2020-09-18): Investigate error messages`
- `author : Manuel Barkhau <mbarkhau@gmail.com>` - `author : Manuel Barkhau <mbarkhau@gmail.com>`
- `date : 2020-09-19T16:24:10` - `date : 2020-09-19T16:24:10`
``` ```
287: def _bump( 389: def _bump(
... ...
315: sys.exit(1) 417: sys.exit(1)
316: except Exception as ex: 418: except Exception as ex:
> 317: # TODO (mb 2020-09-18): Investigate error messages > 419: # TODO (mb 2020-09-18): Investigate error messages
318: logger.error(str(ex)) 420: logger.error(str(ex))
319: sys.exit(1) 421: sys.exit(1)
``` ```
@ -101,7 +84,7 @@ The recommended approach to using `pylint-ignore` is:
- `message: TODO (mb 2020-09-20): New Rollover Behaviour:` - `message: TODO (mb 2020-09-20): New Rollover Behaviour:`
- `author : Manuel Barkhau <mbarkhau@gmail.com>` - `author : Manuel Barkhau <mbarkhau@gmail.com>`
- `date : 2020-09-20T17:36:38` - `date : 2020-10-03T19:31:28`
``` ```
599: def incr( 599: def incr(
@ -116,20 +99,20 @@ The recommended approach to using `pylint-ignore` is:
# W0703: broad-except # W0703: broad-except
## File src/pycalver/__main__.py - Line 316 - W0703 (broad-except) ## File src/pycalver/__main__.py - Line 418 - W0703 (broad-except)
- `message: Catching too general exception Exception` - `message: Catching too general exception Exception`
- `author : Manuel Barkhau <mbarkhau@gmail.com>` - `author : Manuel Barkhau <mbarkhau@gmail.com>`
- `date : 2020-09-05T14:30:17` - `date : 2020-09-05T14:30:17`
``` ```
287: def _bump( 389: def _bump(
... ...
314: logger.error(str(ex)) 416: logger.error(str(ex))
315: sys.exit(1) 417: sys.exit(1)
> 316: except Exception as ex: > 418: except Exception as ex:
317: # TODO (mb 2020-09-18): Investigate error messages 419: # TODO (mb 2020-09-18): Investigate error messages
318: logger.error(str(ex)) 420: logger.error(str(ex))
``` ```

View file

@ -133,11 +133,10 @@ def cli(verbose: int = 0) -> None:
@click.option("-r" , "--release-num", is_flag=True, default=False, help="Increment release number.") @click.option("-r" , "--release-num", is_flag=True, default=False, help="Increment release number.")
@click.option("--pin-date", is_flag=True, default=False, help="Leave date components unchanged.") @click.option("--pin-date", is_flag=True, default=False, help="Leave date components unchanged.")
@click.option( @click.option(
"-d",
"--date", "--date",
default=None, default=None,
metavar="<date>", metavar="<iso-date>",
help=f"Set explicit date in format YYYY-0M-0D (eg. {_current_date}).", help=f"Set explicit date in format YYYY-0M-0D\n(eg. {_current_date}).",
) )
def test( def test(
old_version: str, old_version: str,
@ -212,10 +211,11 @@ def _grep_text(pattern: patterns.Pattern, text: str, color: bool) -> int:
else: else:
lines[1] = matched_line lines[1] = matched_line
print()
for i, line in enumerate(lines): for i, line in enumerate(lines):
print(f"{lines_offset + i:>4}: {line}") print(f"{lines_offset + i:>4}: {line}")
print()
return match_count return match_count
@ -444,7 +444,7 @@ def _try_bump(
@cli.command() @cli.command()
@click.option('-v', '--verbose', count=True, help="Control log level. -vv for debug level.") @click.option('-v', '--verbose', count=True, help="Control log level. -vv for debug level.")
@click.option( @click.option(
"--dry", default=False, is_flag=True, help="Display diff of changes, don't rewrite files." '-d', "--dry", default=False, is_flag=True, help="Display diff of changes, don't rewrite files."
) )
def init(verbose: int = 0, dry: bool = False) -> None: def init(verbose: int = 0, dry: bool = False) -> None:
"""Initialize [pycalver] configuration.""" """Initialize [pycalver] configuration."""
@ -457,7 +457,7 @@ def init(verbose: int = 0, dry: bool = False) -> None:
sys.exit(1) sys.exit(1)
if dry: if dry:
click.echo(f"Exiting because of '--dry'. Would have written to {ctx.config_rel_path}:") click.echo(f"Exiting because of '-d/--dry'. Would have written to {ctx.config_rel_path}:")
cfg_text: str = config.default_config(ctx) cfg_text: str = config.default_config(ctx)
click.echo("\n " + "\n ".join(cfg_text.splitlines())) click.echo("\n " + "\n ".join(cfg_text.splitlines()))
sys.exit(0) sys.exit(0)
@ -489,6 +489,7 @@ def _update_cfg_from_vcs(cfg: config.Config, fetch: bool) -> config.Config:
help="Sync tags from remote origin.", help="Sync tags from remote origin.",
) )
@click.option( @click.option(
"-d",
"--dry", "--dry",
default=False, default=False,
is_flag=True, is_flag=True,
@ -519,11 +520,10 @@ def _update_cfg_from_vcs(cfg: config.Config, fetch: bool) -> config.Config:
@click.option("-r", "--release-num", is_flag=True, default=False, help="Increment release number.") @click.option("-r", "--release-num", is_flag=True, default=False, help="Increment release number.")
@click.option("--pin-date", is_flag=True, default=False, help="Leave date components unchanged.") @click.option("--pin-date", is_flag=True, default=False, help="Leave date components unchanged.")
@click.option( @click.option(
"-d",
"--date", "--date",
default=None, default=None,
metavar="<date>", metavar="<iso-date>",
help=f"Set explicit date in format YYYY-0M-0D (eg. {_current_date}).", help=f"Set explicit date in format YYYY-0M-0D\n(eg. {_current_date}).",
) )
def bump( def bump(
release : typ.Optional[str] = None, release : typ.Optional[str] = None,