Skip to content

Commit dc6d242

Browse files
authored
Use markdownlint instead of mdformat (#1118)
* use markdownlint * add .markdownlint.yaml * fix make lint * use 4 space indent * fix
1 parent 5c4ef45 commit dc6d242

File tree

9 files changed

+76
-52
lines changed

9 files changed

+76
-52
lines changed

.markdownlint.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Default state for all rules
19+
default: true
20+
21+
# MD013/line-length - Line length
22+
MD013: false
23+
24+
# MD007/ul-indent - Unordered list indentation
25+
MD007:
26+
indent: 4

.pre-commit-config.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,11 @@ repos:
4646
hooks:
4747
- id: pycln
4848
args: [--config=pyproject.toml]
49-
- repo: https://github.com/executablebooks/mdformat
50-
rev: 0.7.17
49+
- repo: https://github.com/igorshubovych/markdownlint-cli
50+
rev: v0.41.0
5151
hooks:
52-
- id: mdformat
53-
additional_dependencies:
54-
- mdformat-black==0.1.1
55-
- mdformat-config==0.1.3
56-
- mdformat-beautysh==0.1.1
57-
- mdformat-admon==1.0.1
58-
- mdformat-mkdocs==1.0.1
59-
- mdformat-frontmatter==2.0.1
52+
- id: markdownlint
53+
args: ["--fix"]
6054
- repo: https://github.com/pycqa/pydocstyle
6155
rev: 6.3.0
6256
hooks:

mkdocs/docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<!-- prettier-ignore-start -->
1919

2020
<!-- markdown-link-check-disable -->
21+
# Summary
2122

2223
- [Getting started](index.md)
2324
- [Configuration](configuration.md)

mkdocs/docs/api.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ tbl.overwrite(df)
280280

281281
The data is written to the table, and when the table is read using `tbl.scan().to_arrow()`:
282282

283-
```
283+
```python
284284
pyarrow.Table
285285
city: string
286286
lat: double
@@ -303,7 +303,7 @@ tbl.append(df)
303303

304304
When reading the table `tbl.scan().to_arrow()` you can see that `Groningen` is now also part of the table:
305305

306-
```
306+
```python
307307
pyarrow.Table
308308
city: string
309309
lat: double
@@ -342,7 +342,7 @@ tbl.delete(delete_filter="city == 'Paris'")
342342
In the above example, any records where the city field value equals to `Paris` will be deleted.
343343
Running `tbl.scan().to_arrow()` will now yield:
344344

345-
```
345+
```python
346346
pyarrow.Table
347347
city: string
348348
lat: double
@@ -362,7 +362,6 @@ To explore the table metadata, tables can be inspected.
362362
!!! tip "Time Travel"
363363
To inspect a tables's metadata with the time travel feature, call the inspect table method with the `snapshot_id` argument.
364364
Time travel is supported on all metadata tables except `snapshots` and `refs`.
365-
366365
```python
367366
table.inspect.entries(snapshot_id=805611270568163028)
368367
```
@@ -377,7 +376,7 @@ Inspect the snapshots of the table:
377376
table.inspect.snapshots()
378377
```
379378

380-
```
379+
```python
381380
pyarrow.Table
382381
committed_at: timestamp[ms] not null
383382
snapshot_id: int64 not null
@@ -405,7 +404,7 @@ Inspect the partitions of the table:
405404
table.inspect.partitions()
406405
```
407406

408-
```
407+
```python
409408
pyarrow.Table
410409
partition: struct<dt_month: int32, dt_day: date32[day]> not null
411410
child 0, dt_month: int32
@@ -446,7 +445,7 @@ To show all the table's current manifest entries for both data and delete files.
446445
table.inspect.entries()
447446
```
448447

449-
```
448+
```python
450449
pyarrow.Table
451450
status: int8 not null
452451
snapshot_id: int64 not null
@@ -604,7 +603,7 @@ To show a table's known snapshot references:
604603
table.inspect.refs()
605604
```
606605

607-
```
606+
```python
608607
pyarrow.Table
609608
name: string not null
610609
type: string not null
@@ -629,7 +628,7 @@ To show a table's current file manifests:
629628
table.inspect.manifests()
630629
```
631630

632-
```
631+
```python
633632
pyarrow.Table
634633
content: int8 not null
635634
path: string not null
@@ -679,7 +678,7 @@ To show table metadata log entries:
679678
table.inspect.metadata_log_entries()
680679
```
681680

682-
```
681+
```python
683682
pyarrow.Table
684683
timestamp: timestamp[ms] not null
685684
file: string not null
@@ -702,7 +701,7 @@ To show a table's history:
702701
table.inspect.history()
703702
```
704703

705-
```
704+
```python
706705
pyarrow.Table
707706
made_current_at: timestamp[ms] not null
708707
snapshot_id: int64 not null
@@ -723,7 +722,7 @@ Inspect the data files in the current snapshot of the table:
723722
table.inspect.files()
724723
```
725724

726-
```
725+
```python
727726
pyarrow.Table
728727
content: int8 not null
729728
file_path: string not null
@@ -850,7 +849,7 @@ readable_metrics: [
850849

851850
Expert Iceberg users may choose to commit existing parquet files to the Iceberg table as data files, without rewriting them.
852851

853-
```
852+
```python
854853
# Given that these parquet files have schema consistent with the Iceberg table
855854
856855
file_paths = [
@@ -930,7 +929,7 @@ with table.update_schema() as update:
930929

931930
Now the table has the union of the two schemas `print(table.schema())`:
932931

933-
```
932+
```python
934933
table {
935934
1: city: optional string
936935
2: lat: optional double
@@ -1180,7 +1179,7 @@ table.scan(
11801179

11811180
This will return a PyArrow table:
11821181

1183-
```
1182+
```python
11841183
pyarrow.Table
11851184
VendorID: int64
11861185
tpep_pickup_datetime: timestamp[us, tz=+00:00]
@@ -1222,7 +1221,7 @@ table.scan(
12221221

12231222
This will return a Pandas dataframe:
12241223

1225-
```
1224+
```python
12261225
VendorID tpep_pickup_datetime tpep_dropoff_datetime
12271226
0 2 2021-04-01 00:28:05+00:00 2021-04-01 00:47:59+00:00
12281227
1 1 2021-04-01 00:39:01+00:00 2021-04-01 00:57:39+00:00
@@ -1295,7 +1294,7 @@ ray_dataset = table.scan(
12951294

12961295
This will return a Ray dataset:
12971296

1298-
```
1297+
```python
12991298
Dataset(
13001299
num_blocks=1,
13011300
num_rows=1168798,
@@ -1346,7 +1345,7 @@ df = df.select("VendorID", "tpep_pickup_datetime", "tpep_dropoff_datetime")
13461345

13471346
This returns a Daft Dataframe which is lazily materialized. Printing `df` will display the schema:
13481347

1349-
```
1348+
```python
13501349
╭──────────┬───────────────────────────────┬───────────────────────────────╮
13511350
│ VendorID ┆ tpep_pickup_datetime ┆ tpep_dropoff_datetime │
13521351
---------
@@ -1364,7 +1363,7 @@ This is correctly optimized to take advantage of Iceberg features such as hidden
13641363
df.show(2)
13651364
```
13661365

1367-
```
1366+
```python
13681367
╭──────────┬───────────────────────────────┬───────────────────────────────╮
13691368
│ VendorID ┆ tpep_pickup_datetime ┆ tpep_dropoff_datetime │
13701369
---------

0 commit comments

Comments
 (0)