Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
BasedOnStyle: Google

IndentWidth: 2
ContinuationIndentWidth: 2
TabWidth: 2
UseTab: Never

ColumnLimit: 80

SortIncludes: false
10 changes: 10 additions & 0 deletions .codespell/ignore_words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Please include explanations for each ignored word (lowercase).
# See https://docs.openverse.org/meta/codespell.html for docs.

# src/diffpy/srreal/BaseDebyeSum.cpp:231,233
# variable name
multipl

# src/tests/TestScatteringFactorTable.hpp:73-80
# Custom alias name of C in test
Ccustom
14 changes: 14 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# As of now, flake8 does not natively support configuration via pyproject.toml
# https://github.com/microsoft/vscode-flake8/issues/135
[flake8]
exclude =
.git,
__pycache__,
build,
dist,
doc/source/conf.py
site_scons/* # bring it back after updating scons tools
max-line-length = 115
# Ignore some style 'errors' produced while formatting by 'black'
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#labels-why-pycodestyle-warnings
extend-ignore = E203
113 changes: 101 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
# Compiled Object files
*.slo
*.lo
*.o
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
.exp
.lib
.dll

# Compiled Dynamic libraries
*.so
*.dylib

# Compiled Object files
*.slo
*.lo
*.o

# Compiled Static libraries
*.lai
*.la
*.a.sconf_temp

# SCons build files
*.pyc
.gdb_history
.sconf_temp/
.sconsign.dblite
Expand All @@ -24,16 +31,98 @@ errors.err
/sconsvars.py
tags

# eclipse
# Distribution / packaging
.Python
env/
build/
_build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
venv/
*.egg-info/
.installed.cfg
*.egg
bin/
temp/
tags/
errors.err

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt
MANIFEST

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# source distribution tarball
libdiffpy-*.tar.gz
# Django stuff:
*.log

# Sphinx documentation
docs/build/
docs/source/generated/

# pytest
.pytest_cache/

# PyBuilder
target/

# Editor files
# mac
.DS_Store
*~

# vim
*.swp
*.swo

# pycharm
.idea/

# VSCode
.vscode/

# Visual Studio
.vs/*
.exp
.lib
.dll
.vscode/*

# eclipse
.project
.pydevproject

# Ipython Notebook
.ipynb_checkpoints

# source distribution tarball
libdiffpy-*.tar.gz
5 changes: 5 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[settings]
# Keep import statement below line_length character limit
line_length = 115
multi_line_output = 3
include_trailing_comma = True
84 changes: 84 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
default_language_version:
python: python3

exclude: (?x)^.*\.(cif|dat)$

ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit hooks
autofix_prs: true
autoupdate_branch: "pre-commit-autoupdate"
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: monthly
skip: [no-commit-to-branch]
submodules: false

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-added-large-files

- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
files: \.py$

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]
files: \.py$

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
files: \.py$

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v20.1.6
hooks:
- id: clang-format
name: clang-format (C/C++)
files: \.(c|cpp|cc|cxx|h|hpp|hh)$

# Add this back after maintainance
# - repo: https://github.com/cpplint/cpplint
# rev: 2.0.2
# hooks:
# - id: cpplint
# name: cpplint (C/C++)
# files: \.(c|cc|cpp|cxx|h|hh|hpp|hxx)$
# args:
# - --filter=
# -whitespace/line_length
# ,-legal/copyright
# ,-build/header_guard
# ,-build/include_order
# ,-build/include_what_you_use

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
- tomli
args:
- "--ignore-words=./.codespell/ignore_words.txt"

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: no-commit-to-branch
name: Prevent commit to main branch
args: ["--branch", "main"]
stages: [pre-commit]
34 changes: 0 additions & 34 deletions .travis-sconscript.local

This file was deleted.

Loading