Skip to content

Commit 1a1680d

Browse files
authored
Merge pull request #71 from bcdev/clarasb-66-time_coordinates
Add ms, µs and ns to time coordinates
2 parents cbaf81a + a7de3d0 commit 1a1680d

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# XRLint Change History
22

3+
## Version 0.5.2 (in development)
4+
5+
### Adjustments and Enhancements
6+
7+
- Core rule 'time-coordinates' now support ms, µs and ns. (#66)
8+
39
## Version 0.5.1 (from 2025-02-21)
410

511
- XRLint now also loads default configuration from files named

xrlint/plugins/core/rules/time_coordinate.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,27 @@
3535
"second",
3636
"sec",
3737
"s",
38+
"milliseconds",
39+
"millisecond",
40+
"ms",
41+
"microseconds",
42+
"microsecond",
43+
"µs",
44+
"nanoseconds",
45+
"nanosecond",
46+
"ns",
3847
)
3948

4049
_ALL_UNITS_OF_TIME = (*_AMBIGUOUS_UNITS_OF_TIME, *_UNAMBIGUOUS_UNITS_OF_TIME)
4150

4251
_RE_DATE = re.compile(r"^\d{4}-\d{1,2}-\d{1,2}$")
43-
_RE_TIME = re.compile(r"^\d{1,2}:\d{1,2}:\d{1,2}(\.\d{1,6})?$")
52+
_RE_TIME = re.compile(r"^\d{1,2}:\d{1,2}:\d{1,2}(\.\d{1,9})?$")
4453
_RE_TZ = re.compile(r"^[+-]\d{1,2}:\d{1,2}$")
4554

4655

4756
@plugin.define_rule(
4857
"time-coordinate",
49-
version="1.0.0",
58+
version="1.0.1",
5059
type="problem",
5160
description=(
5261
"Time coordinates should have valid and unambiguous time units encoding."

xrlint/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# This software is distributed under the terms and conditions of the
33
# MIT license (https://mit-license.org/).
44

5-
version = "0.5.1"
5+
version = "0.5.2.dev0"

0 commit comments

Comments
 (0)