File tree Expand file tree Collapse file tree 6 files changed +31
-26
lines changed Expand file tree Collapse file tree 6 files changed +31
-26
lines changed Original file line number Diff line number Diff line change 2727"""
2828
2929import keras
30-
31- # Needed for the dataset
32- import tensorflow as tf
30+ import tensorflow as tf # Needed for the dataset
3331import tensorflow_datasets as tfds
3432
3533"""
@@ -113,7 +111,6 @@ def preprocess_rating(x):
113111
114112
115113class RankingModel (keras .Model ):
116-
117114 def __init__ (
118115 self ,
119116 num_users ,
Original file line number Diff line number Diff line change 6262"""
6363
6464import keras
65-
66- # Needed for the dataset
67- import tensorflow as tf
65+ import tensorflow as tf # Needed for the dataset
6866import tensorflow_datasets as tfds
6967
7068import keras_rs
Original file line number Diff line number Diff line change 1- [tool .black ]
1+ [tool .ruff ]
22line-length = 80
33
4- [tool .isort ]
5- profile = " black"
6- force_single_line = " True"
7- single_line_exclusions = [" typing" ]
8- known_first_party = [" keras_rs" ]
9- default_section = " THIRDPARTY"
10- line_length = 80
4+ [tool .ruff .lint ]
5+ select = [
6+ " E" , # pycodestyle error
7+ " F" , # Pyflakes
8+ " I" , # isort
9+ ]
10+
11+ [tool .ruff .lint .per-file-ignores ]
12+ "**/__init__.py" = [" F401" ] # imported but unused
13+
14+ [tool .ruff .lint .isort ]
15+ force-single-line = true
16+ single-line-exclusions = [" typing" ]
17+ known-first-party = [" keras_rs" ]
1118
1219[tool .mypy ]
1320strict = " True"
Original file line number Diff line number Diff line change 22namex>=0.0.8
33
44# formatting and linting
5- black>=22
6- flake8
7- isort
85mypy
6+ ruff
97
108# testing
119absl-py
Original file line number Diff line number Diff line change 11#! /bin/bash
2- set -Eeuo pipefail
2+ set -Euo pipefail
33
44base_dir=$( dirname $( dirname $0 ) )
55targets=" ${base_dir} "
66
7- isort --sp " ${base_dir} /pyproject.toml" ${targets}
8- black --config " ${base_dir} /pyproject.toml" ${targets}
9- flake8 --config " ${base_dir} /setup.cfg" ${targets}
7+ ruff check --config " ${base_dir} /pyproject.toml" --fix ${targets}
8+ ruff format --config " ${base_dir} /pyproject.toml" ${targets}
109mypy --config-file " ${base_dir} /pyproject.toml" ${targets}
Original file line number Diff line number Diff line change 11#! /bin/bash
2- set -Eeuo pipefail
2+ set -Euo pipefail
33
44base_dir=$( dirname $( dirname $0 ) )
55targets=" ${base_dir} "
66
7- isort --sp " ${base_dir} /pyproject.toml" --check ${targets}
8- black --config " ${base_dir} /pyproject.toml" --check ${targets}
9- flake8 --config " ${base_dir} /setup.cfg" ${targets}
7+ ruff check --config " ${base_dir} /pyproject.toml" ${targets}
8+ exitcode=$?
9+
10+ ruff format --check --config " ${base_dir} /pyproject.toml" ${targets}
11+ exitcode=$(( $exitcode + $? ))
12+
1013mypy --config-file " ${base_dir} /pyproject.toml" ${targets}
14+ exitcode=$(( $exitcode + $? ))
15+
16+ exit $exitcode
You can’t perform that action at this time.
0 commit comments