File: lint-inits.sh

package info (click to toggle)
python-parsl 2025.01.13%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,072 kB
  • sloc: python: 23,817; makefile: 349; sh: 276; ansic: 45
file content (18 lines) | stat: -rwxr-xr-x 556 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash -e

# Check that each directory with python source in it has a __init__.py
# file in it too. Often code will work in most situations without an
# __init__.py but some corner cases can arise that are awkward to debug;
# so the policy is that every directory must have __init__.py

find parsl -name \*.py \
  | while read fn; do
      dirname $fn
    done \
  | sort | uniq \
  | while read dir; do
      if [ -f ${dir}/__init__.py ] ;
        then true;
        else echo FAILURE: $dir does not have an __init__.py ; exit 1;
      fi; 
    done