Skip to content

Commit 0485601

Browse files
committed
ADD-WIP: basic structure for pre-commits local + mypy setup
1 parent 39ee208 commit 0485601

46 files changed

Lines changed: 134 additions & 88 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

deps/cgal/auxiliary/gdb/python/CGAL/printers.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def lookup_function (val):
2323
# Get the unqualified type, stripped of typedefs.
2424
type = type.unqualified ().strip_typedefs ()
2525

26-
# Get the type name.
26+
# Get the type name.
2727
typename = type.tag
2828
if typename == None:
2929
return None
@@ -34,7 +34,7 @@ def lookup_function (val):
3434
for function in CGAL_pretty_printers_dict:
3535
if function.search (typename):
3636
return CGAL_pretty_printers_dict[function] (val)
37-
37+
3838
# Cannot find a pretty printer. Return None.
3939
return None
4040

@@ -43,15 +43,15 @@ def lookup_function (val):
4343
class CGAL_Handle_for:
4444
def __init__(self, val):
4545
self.val = val
46-
46+
4747
def to_string (self):
4848
node = self.val['ptr_'].dereference()
4949
return 'Handle_for(%s , refcount=%d)' % (node['t'],node['count'])
5050

5151
class CGAL_Point_2:
5252
def __init__(self, val):
5353
self.val = val
54-
54+
5555
def to_string (self):
5656
node = self.val;
5757
type = self.val.type
@@ -64,15 +64,15 @@ def to_string (self):
6464
class CGAL_Tdsvb3:
6565
def __init__(self, val):
6666
self.val = val
67-
67+
6868
def to_string (self):
6969
node = self.val;
7070
return 'CGAL::Tvb_3(%s)' % node['_p']
7171

7272
class CGAL_Point_3:
7373
def __init__(self, val):
7474
self.val = val
75-
75+
7676
def to_string (self):
7777
node = self.val;
7878
type = self.val.type
@@ -86,23 +86,23 @@ class CGAL_Vector_2:
8686
def __init__(self, val, name):
8787
self.val = val
8888
self.name = name
89-
89+
9090
def to_string (self):
9191
node = self.val['base']
9292
return 'CGAL::%s(%s)' % (self.name, node)
9393

9494
class CGAL_Array:
9595
def __init__(self, val):
9696
self.val = val
97-
97+
9898
def to_string (self):
9999
node = self.val['_M_instance']
100100
return node
101101

102102
class CGAL_Boost_tuples:
103103
def __init__(self, val):
104104
self.val = val
105-
105+
106106
def to_string (self):
107107
return '{%s}' % self.display_head_and_continue(self.val)
108108

@@ -135,4 +135,3 @@ def display_head_and_continue(self, val):
135135

136136
CGAL_pretty_printers_dict[re.compile('^(std|boost)(::tr1)?(::tuples)?::tuple<.*>')] = lambda val: CGAL_Boost_tuples(val)
137137
#p2 = gdb.selected_frame().read_var('p2')
138-

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
'navigation_with_keys': False,
189189
}
190190

191-
# Add any paths that contain custom
191+
# Add any paths that contain custom
192192
# static files (such as style sheets) here,
193193
# relative to this directory. They are copied after the builtin static files,
194194
# so a file named "default.css" will overwrite the builtin "default.css".
@@ -339,4 +339,4 @@ def linkcode_resolve(domain, info):
339339
return None
340340
filename = os.path.relpath(filename, start=os.path.dirname(diffCheck.__file__))
341341
lines = f"#L{linenum}-L{linenum + len(source)}" if linenum else ""
342-
return f"https://github.com/diffCheckOrg/diffCheck/blob/main/diffCheck/{filename}{lines}"
342+
return f"https://github.com/diffCheckOrg/diffCheck/blob/main/diffCheck/{filename}{lines}"

doc/contribute.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
(contrib_guide)=
22
# Contribute
33

4-
We value all contributions to diffCheck, whether they are bug reports, feature requests, or pull requests. We have a few guidelines to ensure that the process is as smooth as possible.
4+
We welcome pull requests from everyone. Please have a look at the [issue](https://github.com/diffCheckOrg/diffCheck/issues) list to see if there is something you can help with. If you have a new feature in mind, please open an issue to discuss it first.
55

6-
## How to contribute
6+
## Code quality
77

8-
We welcome pull requests from everyone. Please have a look at the [issue](https://github.com/diffCheckOrg/diffCheck/issues) list to see if there is something you can help with. If you have a new feature in mind, please open an issue to discuss it first.
8+
We run [mypy](https://mypy.readthedocs.io/en/stable/index.html) and [] on pre-commit hooks to ensure code quality. Please make sure to run the following commands before submitting a pull request:
99

10-
To contribute, you will need to install your developer's environment to build the project. You can find the instructions in the [development installation guide](dev_documentation).
10+
```console
11+
pre-commit run --all-files
12+
```
13+
14+
## How to contribute
1115

1216
Next, fall the following steps:
1317

@@ -24,4 +28,10 @@ Next, fall the following steps:
2428

2529
```console
2630
git checkout -b my-feature
27-
```
31+
```
32+
33+
4. Add the diffCheck repository as a remote for convinience:
34+
35+
```console
36+
git remote add upstream https://github.com/diffCheckOrg/diffCheck
37+
```

doc/sphinx_ghcomponent_parser/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def run(self):
2424
metadata_json_file = os.path.join(ghcomponent_dir, 'metadata.json')
2525
pycode_file = os.path.join(ghcomponent_dir, 'code.py')
2626
icon_file = os.path.join(ghcomponent_dir, 'icon.png')
27-
27+
2828
metadata = metadata_parser.MetadataParser(metadata_json_file)
2929

3030
##########################################################################
@@ -47,7 +47,7 @@ def run(self):
4747
table += tgroup
4848
tgroup += nodes.colspec(colwidth=1)
4949
tgroup += nodes.colspec(colwidth=1)
50-
50+
5151
tbody = nodes.tbody()
5252
tgroup += tbody
5353
if metadata.get_input_parameters():
@@ -71,7 +71,7 @@ def run(self):
7171
table += tgroup
7272
tgroup += nodes.colspec(colwidth=1)
7373
tgroup += nodes.colspec(colwidth=1)
74-
74+
7575
tbody = nodes.tbody()
7676
tgroup += tbody
7777
if metadata.get_output_parameters():
@@ -103,4 +103,4 @@ def setup(app):
103103
'version': '0.1',
104104
'parallel_read_safe': True,
105105
'parallel_write_safe': True,
106-
}
106+
}

doc/sphinx_ghcomponent_parser/metadata_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def return_rst_content(self):
6161
# for key, value in self.get_ghpython_settings().items():
6262
# content.append(f"{'#' * 3} {key}: {value}")
6363

64-
64+
6565

6666
params = self.get_input_parameters()
6767
# if params: # Ensure params is not empty
@@ -104,4 +104,4 @@ def return_rst_content(self):
104104
# content.append(f"{'#' * 3} Wire Display: {param.get('wireDisplay', '')}")
105105
# content.append(f"{'#' * 3} Source Count: {param.get('sourceCount', 0)}")
106106
# content.append(f"{'#' * 3} Type Hint ID: {param.get('typeHintID', '')}")
107-
# return content
107+
# return content

doc/test_pybind_dll_smoke.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626

2727
# if __name__ == "__main__":
2828
# pytest.main()
29-
print(">>>>>>>>>>>>>>>>> test_pybind_dll_smoke.py succeded <<<<<<<<<<<<<<<<<<<<")
29+
print(">>>>>>>>>>>>>>>>> test_pybind_dll_smoke.py succeded <<<<<<<<<<<<<<<<<<<<")

environment.yml

166 Bytes
Binary file not shown.

invokes/flagerize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,4 @@ def main(
148148
print("[x] Done flagerizing components.")
149149
else:
150150
print("[ ] Failed flagerizing components.")
151-
sys.exit(1)
151+
sys.exit(1)

invokes/ghcomponentize/ghcomponentizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def create_ghuser_component(source, target, version=None, prefix=None):
382382
sys.exit(-1)
383383

384384
clr.AddReference(os.path.splitext(gh_io)[0])
385-
385+
386386
print("[x] GH_IO assembly: {}".format(gh_io))
387387

388388
print("Processing component bundles:")
@@ -391,4 +391,4 @@ def create_ghuser_component(source, target, version=None, prefix=None):
391391
target = os.path.join(targetdir, d + ".ghuser")
392392
print(" [ ] {}\r".format(d), end="")
393393
create_ghuser_component(source, target, args.version, args.prefix)
394-
print(" [x] {} => {}".format(d, target))
394+
print(" [x] {} => {}".format(d, target))

invokes/pypireize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ def main(
5858
print("[x] Pypireize task completed.")
5959
else:
6060
print("[ ] Pypireize task failed.")
61-
sys.exit(1)
61+
sys.exit(1)

0 commit comments

Comments
 (0)