Skip to content

Commit

Permalink
style: add linting and pre-commit (#40)
Browse files Browse the repository at this point in the history
* style: add linting rules

* style: linting on examples

* style: linting embedding

* style: linting init in embeddings

* style: init title embedding

* style: linting kweight

* style: minor change

* style: optimize linting

* fix: circular imports

* docs: update todo

* style: helpers linting

* style: lattice solver linting

* style: test linting

* style: linting apply formatting

* style: pre-commit hooks

* style: prettier pre-commit hook
  • Loading branch information
thenoursehorse authored May 17, 2024
1 parent a2e7aee commit 17a9e17
Show file tree
Hide file tree
Showing 64 changed files with 2,910 additions and 2,191 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ docker-compose*
Dockerfile*

# git files
.git/objects/pack
.git/objects/pack
2 changes: 1 addition & 1 deletion .git_archival.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
ref-names: $Format:%D$
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Auto detect text files and perform LF normalization
* text=auto

.git_archival.txt export-subst
.git_archival.txt export-subst
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#global ownrs
* @thenoursehorse
* @thenoursehorse
186 changes: 91 additions & 95 deletions .github/actions/setup-triqs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,109 +24,105 @@ runs:
using: "composite"

steps:
- name: Setup Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
allow-prereleases: true

- name: Install updates
shell: bash
run: |
sudo apt-get update &&
sudo apt-get install -y lsb-release wget software-properties-common
- name: Install clang
shell: bash
if: ${{ contains(inputs.cc, 'clang') }}
run:
wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh &&
sudo chmod +x /tmp/llvm.sh &&
sudo /tmp/llvm.sh ${{ inputs.llvm }} &&
sudo apt-get install -y
- name: Setup Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
allow-prereleases: true

- name: Install updates
shell: bash
run: |
sudo apt-get update &&
sudo apt-get install -y lsb-release wget software-properties-common
- name: Install clang
shell: bash
if: ${{ contains(inputs.cc, 'clang') }}
run: wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh &&
sudo chmod +x /tmp/llvm.sh &&
sudo /tmp/llvm.sh ${{ inputs.llvm }} &&
sudo apt-get install -y
clang-${{ inputs.llvm }}
lldb-${{ inputs.llvm }}
libclang-${{ inputs.llvm }}-dev
libc++-${{ inputs.llvm }}-dev
libc++abi-${{ inputs.llvm }}-dev
libclang-${{ inputs.llvm }}-dev
libc++-${{ inputs.llvm }}-dev
libc++abi-${{ inputs.llvm }}-dev
libomp-${{ inputs.llvm }}-dev &&
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV

- name: Install gcc
shell: bash
if: ${{ contains(inputs.cc, 'gcc') }}
run:
sudo apt-get install -y
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV

- name: Install gcc
shell: bash
if: ${{ contains(inputs.cc, 'gcc') }}
run: sudo apt-get install -y
g++-${{ inputs.gcc-version }}

- name: Install ubuntu dependencies
shell: bash
run:
sudo apt-get install -y
cmake
gfortran
git
hdf5-tools
libfftw3-dev
libgfortran5
libgmp-dev
libhdf5-dev
libblas-dev
liblapack-dev
libboost-dev
libopenmpi-dev
openmpi-bin
openmpi-common
- name: Install ubuntu dependencies
shell: bash
run: sudo apt-get install -y
cmake
gfortran
git
hdf5-tools
libfftw3-dev
libgfortran5
libgmp-dev
libhdf5-dev
libblas-dev
liblapack-dev
libboost-dev
libopenmpi-dev
openmpi-bin
openmpi-common
python3-dev

- name: Install python dependencies
shell: bash
run:
python -m pip install
mako
mpi4py
h5py
numpy
scipy
clang

- name: Setup clang environment
shell: bash
if: ${{ contains(inputs.cc, 'clang') }}
run: |
echo "CC=${{ inputs.cc }}-${{ inputs.llvm }}" >> $GITHUB_ENV
echo "CXX=${{ inputs.cxx }}-${{ inputs.llvm }}" >> $GITHUB_ENV
- name: Setup gcc environment
shell: bash
if: ${{ contains(inputs.cc, 'gcc') }}
run: |
echo "CC=${{ inputs.cc }}-${{ inputs.gcc-version }}" >> $GITHUB_ENV
echo "CXX=${{ inputs.cxx }}-${{ inputs.gcc-version }}" >> $GITHUB_ENV
- name: Cache build TRIQS
id: build-triqs
uses: actions/cache@v4
with:
path: triqs
key: triqs-${{ inputs.os }}-${{ inputs.python-version }} ${{ inputs.cc }}-${{ inputs.llvm }}-${{ inputs.gcc-version }}
- name: Install python dependencies
shell: bash
run: python -m pip install
mako
mpi4py
h5py
numpy
scipy
clang

- name: Setup clang environment
shell: bash
if: ${{ contains(inputs.cc, 'clang') }}
run: |
echo "CC=${{ inputs.cc }}-${{ inputs.llvm }}" >> $GITHUB_ENV
echo "CXX=${{ inputs.cxx }}-${{ inputs.llvm }}" >> $GITHUB_ENV
- name: Setup gcc environment
shell: bash
if: ${{ contains(inputs.cc, 'gcc') }}
run: |
echo "CC=${{ inputs.cc }}-${{ inputs.gcc-version }}" >> $GITHUB_ENV
echo "CXX=${{ inputs.cxx }}-${{ inputs.gcc-version }}" >> $GITHUB_ENV
- name: Cache build TRIQS
id: build-triqs
uses: actions/cache@v4
with:
path: triqs
key: triqs-${{ inputs.os }}-${{ inputs.python-version }} ${{ inputs.cc }}-${{ inputs.llvm }}-${{ inputs.gcc-version }}

- name: Build TRIQS
shell: bash
if: steps.build-triqs.outputs.cache-hit != 'true'
run: |
git clone https://github.com/TRIQS/triqs
mkdir triqs/build && cd triqs/build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/triqs_install -DBuild_Documentation=OFF -DBuild_Tests=OFF
make -j1 VERBOSE=1
cd ../../
- name: Build TRIQS
shell: bash
if: steps.build-triqs.outputs.cache-hit != 'true'
run: |
git clone https://github.com/TRIQS/triqs
mkdir triqs/build && cd triqs/build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/triqs_install -DBuild_Documentation=OFF -DBuild_Tests=OFF
make -j1 VERBOSE=1
cd ../../
- name: Install TRIQS
shell: bash
run: |
cd triqs/build && make install && cd ../../
echo "TRIQS_INSTALL=$HOME/triqs_install" >> $GITHUB_ENV
- name: Install TRIQS
shell: bash
run: |
cd triqs/build && make install && cd ../../
echo "TRIQS_INSTALL=$HOME/triqs_install" >> $GITHUB_ENV
branding:
icon: "package"
color: "purple"
color: "purple"
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ updates:
groups:
actions:
patterns:
- "*"
- "*"
Loading

0 comments on commit 17a9e17

Please sign in to comment.